I am working on a batch file to run a program from the local servers on each subnet. The base of the code was copied directly from another question here on Experts. The code itself does not want to run one it gets to the goto command. Heres a copy of my code If REM the first two lines and un REM the next two i will get errors on those either a syntax error or unexpected | error. Any help would be great.
IPCONFIG |FIND "IP" >TEMPIP.tmp
set IP=%% iecho %IP% >> c:tempip.tmp
REM for /f "tokens=2 delims=:" %%i in ('ipconfig /all ^| find "IP Address"') do set GetIP=%%d
REM do set IP=%% iecho %IP% >> c:tempip.tmp
for /f "tokens=3 delims=." %%j in (c:\tempip.tmp) do set SUBNET=%%j
if %SUBNEt%==10 goto 10subnet
if %SUBNET%==12 goto 12subnet
if %SUBNET%==14 goto 14subnet
if %SUBNET%==16 goto 16SUBNET
if %SUBNET%==11 goto 11subnet
if %SUBNET%==15 goto 15subnet
goto ALL_USERS
:16SUBNET
"\\sn1-100835\Apps Installs\Engineering\AutoC
AD\Patches
\AutoDesk Land Desktop 2008\ldc2008_sp2.exe"
echo Welcome to the 16 subnet!
goto ALL_USERS
:12SUBNET
"\\sy1-100998\apps installs\Engineering\AutoC
AD\Patches
\AutoDesk Land Desktop 2008\ldc2008_sp2.exe"
echo Welcome to the 100 subnet!
goto ALL_USERS
:10SUBNET
"\\sm1-100997\apps installs\Engineering\AutoC
AD\Patches
\AutoDesk Land Desktop 2008\ldc2008_sp2.exe"
echo Welcome to the 250 subnet!
goto ALL_USERS
:14SUBNET
"\\sa1-100977\apps installs\Engineering\AutoC
AD\Patches
\AutoDesk Land Desktop 2008\ldc2008_sp2.msp"
echo Welcome to the 250 subnet!
goto ALL_USERS
:15SUBNET
"\\sl1-100239\apps installs\Engineering\AutoC
AD\Patches
\AutoDesk Land Desktop 2008\ldc2008_sp2.exe"
echo Welcome to the 250 subnet!
goto ALL_USERS
:ALL_USERS
REM Use this section to perform functions that pertain to all users
goto END
:END
Thanks!
Start Free Trial