Hi all
I have a query that I hope somone can help with.
Within the WAN I maintain, there are multiple subnets i.e. 192.168.1.X ...... 192.168.2.X
I would like to know is it possible to have the script I use when my unattended WinXp installation is finished to look at what subnet its on and call on a script to install the software from a specific location. i.e. If subnet=192.168.2.X then run InstallA.bat, if subnet=192.168.3.X then run InstallB.bat and so on.
Any ideas or help greatly appreciated.
Thanks
Rathcoffey
Page 1 of 1
Unattended Batch Scripts
#2
Posted 21 February 2005 - 02:11 PM
Wrong forum... Should be moved to Unattended Windows
#3
Posted 21 February 2005 - 02:23 PM
A simple batchfile to determine which network you are in. Note that the goto :EOF isn't needed here as you don't return to this script after executing the InstallX.bat batch file. If you need to return use "call InstallX.bat" in place of "InstallX.bat".
@echo off
ipconfig | find "IP Address" | find "192.168.1." >nul:
if not errorlevel 1 (
echo In 192.168.1.x network
InstallA.bat
goto :EOF
)
ipconfig | find "IP Address" | find "192.168.2." >nul:
if not errorlevel 1 (
echo In 192.168.2.x network
InstallB.bat
goto :EOF
)
If you are installing the same software but from a different location you could replaxe the InstallX.bat with a net use command to map the network drive.
@echo off
ipconfig | find "IP Address" | find "192.168.1." >nul:
if not errorlevel 1 (
echo In 192.168.1.x network
net use z: \\server\share
goto :Install
)
ipconfig | find "IP Address" | find "192.168.2." >nul:
if not errorlevel 1 (
echo In 192.168.2.x network
net use z: \\server\share
goto :Install
)
:Install
rem install softeare here
rem delete mapped drive
net use z: /delete
@echo off
ipconfig | find "IP Address" | find "192.168.1." >nul:
if not errorlevel 1 (
echo In 192.168.1.x network
InstallA.bat
goto :EOF
)
ipconfig | find "IP Address" | find "192.168.2." >nul:
if not errorlevel 1 (
echo In 192.168.2.x network
InstallB.bat
goto :EOF
)
If you are installing the same software but from a different location you could replaxe the InstallX.bat with a net use command to map the network drive.
@echo off
ipconfig | find "IP Address" | find "192.168.1." >nul:
if not errorlevel 1 (
echo In 192.168.1.x network
net use z: \\server\share
goto :Install
)
ipconfig | find "IP Address" | find "192.168.2." >nul:
if not errorlevel 1 (
echo In 192.168.2.x network
net use z: \\server\share
goto :Install
)
:Install
rem install softeare here
rem delete mapped drive
net use z: /delete
#4
Posted 23 February 2005 - 04:52 AM
@FrankE9999: Thanks for that....thats exactly what i wanted. Big star for you
@Bâshrat the Sneaky: Sorry about that. Great work on the driverpacks.....you're a legend!
@Bâshrat the Sneaky: Sorry about that. Great work on the driverpacks.....you're a legend!
Share this topic:
Page 1 of 1



Help
Back to top









