In Citrix or Microsoft Terminal Server environments it can be useful to detect what machine the client is connecting from. With Citrix and TS installations, the users might move around but the terminals themselves stay put.
In this example, there are thin clients in three offices - London, Cardiff and Edinburgh. Each thin client is named WBT<location letter>-<asset number> where <location letter> is the first letter of the place name (l, c or e) and asset number is a five digit number.
Note: Numbers in the notes correspond with the numbers down the side of the example script.
1. if defined CLIENTNAME goto next
echo This is not a thin client.
rem Check where thin client is located.
IF NOT %v_part_name%==WBT GOTO :desktop
3. SET v_part_name=%CLIENTNAME:~0,4%
IF %v_part_name%==WBTL GOTO :london
IF %v_part_name%==WBTC GOTO :cardiff
IF %v_part_name%==WBTE GOTO :edinburgh
4 net send %username% "Your thin client doesn't have location information. Get the configuration checked" 5. :desktop
rem desktop settings
rem london settings
rem cardiff settings
rem Edinburgh settings
Complete Sample - Ready to Copy and Paste.
Remember to turn off word wrap when working in notepad
Copyright Sembee Ltd. 1998 - 2015.
Reproduction of any content on this web site is prohibited without express written consent. Use of this web site is subject to our terms and conditions.
All trademarks and registered trademarks are property of their respective owners. This site is not endorsed or recommended by any company or organisation mentioned within and is to provide guidance only and as such we cannot be held responsible for any consequences of following the advice given.
Sembee Ltd. is registered in England and Wales at 1 Carnegie Road, Newbury, Berkshire, RG14 5DJ.
Registered company number: 4704428. VAT Number GB 904 5603 43.