rathcoffey Posted February 21, 2005 Share Posted February 21, 2005 Hi allI 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.XI 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.ThanksRathcoffey Link to comment Share on other sites More sharing options...
Bâshrat the Sneaky Posted February 21, 2005 Share Posted February 21, 2005 Wrong forum... Should be moved to Unattended Windows Link to comment Share on other sites More sharing options...
FrankE9999 Posted February 21, 2005 Share Posted February 21, 2005 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 offipconfig | 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 offipconfig | 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):Installrem install softeare hererem delete mapped drivenet use z: /delete Link to comment Share on other sites More sharing options...
rathcoffey Posted February 23, 2005 Author Share Posted February 23, 2005 @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! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now