We use the following script to determine the location of a PC and define a UNC's and drive letters and then run some commands based on the UNC's. Everything works fine, but I just feel like there has to be a better way. Does anyone know if there is a cleaner way to do this?SELECT
CASE ($IP0 = "167. 64. 12." or $IP1 = "167. 64. 12." or
$IP0 = "167. 64. 24." or $IP1 = "167. 64. 24." or
$IP0 = "167. 64. 64." or $IP1 = "167. 64. 64." or
$IP0 = "167. 64.105." or $IP1 = "167. 64.105." or
$IP0 = "167. 64.111." or $IP1 = "167. 64.111." or
$IP0 = "167. 64.112." or $IP1 = "167. 64.112." or
$IP0 = "167. 64.115." or $IP1 = "167. 64.115." or
$IP0 = "167. 64.116." or $IP1 = "167. 64.116." or
$IP0 = "167. 64.168." or $IP1 = "167. 64.168." or
$IP0 = "167. 64.188." or $IP1 = "167. 64.188." or
$IP0 = "167. 64.237." or $IP1 = "167. 64.237.")
goto END
;Long Island City, NY
CASE $IP0 = " 10. 18. 3." or $IP1 = " 10. 18. 3."
$S="\\BFBF2PDC\"
$T="\\BFBF2PDC\"
goto SEAGATE
;Manhatten, NY
CASE $IP0 = " 10. 20. 2." or $IP1 = " 10. 20. 2."
$S="\\BFMH2BDC\"
$T="\\BFMH2BDC\"
goto SEAGATE
;Johnstown, PA - ****NO SERVER YET*****
;CASE $IP0 = " 10. 20. 1." or $IP1 = " 10. 20. 1."
; $S="\\BF????\"
; goto END
;Martinsville, VA
CASE $IP0 = " 10. 17. 5." or $IP1 = " 10. 17. 5."
$S="\\BWMV2DMS\"
$T="\\BWMV2DMS\"
goto SEAGATE
;PA
CASE $IP0 = " 10. 20. 4." or $IP1 = " 10. 20. 4."
$S="\\BWMV2DMS\"
$T="\\BWMV2DMS\"
goto SEAGATE
ENDSELECT
:SEAGATE
$V=$T+"WLAND\AGENTS\DOS_AG.COM /SW"
$W=$T+"WLAND\AGENTS\WIN_AG.EXE"
IF INGROUP ("NO_WINLAND") GOTO WINSTALL ENDIF
;** Determine Operating System 1 = Windows NT, 2 = Windows 95 **
if @inwin = 1
SHELL "%COMSPEC% /C START /W /MIN $V"
else
SHELL "%COMSPEC% /C START /W /M $V"
;SHELL "%COMSPEC% /C START $W"
:WINSTALL
IF INGROUP ("NO_WININSTALL") GOTO MAPX ENDIF
$Sea65Notins = "HKEY_LOCAL_MACHINE\SOFTWARE\OnDemand\WinINSTALL\Version 5.1\Applications"
$Sea65ins = "HKEY_LOCAL_MACHINE\SOFTWARE\Seagate Software\WinINSTALL\Version 6\Applications"
IF ExistKey("$Sea65NotIns") = 0
SHELL "$U1"
ENDIF
:END
EXIT