- Need batch file or similar to start network connection on start up
- Posted by ynott on February 2nd, 2007
Here's the problem. We have several trucks with mobile computers
running XP SP2. We use a managing software to switch between both
connections, a WiFi and a Sprint connection. In the past, our users
would disable the WiFi connection in the network neighborhood since
the connection is unavailable at times due to the managing software
during their shift. At the end of the day, the user didn't have to
enable the WiFi connection since it would automatically become enabled
during the next start up. Unfortunately with our new configuration,
you must enable it and XP doesn't automatically start it anymore.
Since we load large daily files automatcally on the WiFi connection
only, we're having problems since our users forget to enable the
connections again.
Is there away in XP to make sure that the network connection enables
itself during the start up process? If not, is there a command that a
batch file might use that we can place in the start up folder?
Thx
- Posted by Michael Bednarek on February 2nd, 2007
On 1 Feb 2007 21:03:04 -0600, ynott wrote in alt.msdos.batch:
This is not really the best newsgroup for this question. You probably
get more helpful advice in newsgroups which are more closely related to
your operating system and the problem at hand: scripting network
configurations. So any newsgroups with "NT" or "XP" (after all, XP =
NT5.1) and "scripting" and/or "networking" in their name are more likely
to yield results.
However, as a start you might want to investigate what NETSH.EXE can do.
Another avenue might be VBS scripting using Windows Management
Instrumentation (WMI), which also provides the command line utility
WMIC. Be prepared for a steep learning curve.
Good luck.
--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
- Posted by Steve Signorelli on February 2nd, 2007
I made this code to remotely disable a WLAN NIC on a laptop. You could
easily hack out the remote aspect of it and make it local. Ultimately
get comfortable with using the devcon.exe command line device manager.
Each WLAN card model is going to have a unique value for the card
which I reference as TargetNIC. I hope this helps you. -Steve
Signorelli
::Setting Environment from U: to C:
%SYSTEMDRIVE%
CLS
GOTO NAVTARGETMACHINEIP
:NAVTARGETMACHINEIP
::Prompting technician for machine name/IP which to connect
SET /P TargetMachineIP=Please enter the machine name or IP address:
GOTO PUSHFILES
:NAVTARGETMACHINETYPE
ECHO.
ECHO 1. IBM T-40
ECHO 2. IBM T-41
ECHO 3. IBM T-42
ECHO 4. IBM T-43
ECHO 5. IBM T-60
ECHO 6. IBM X-30
ECHO 7. IBM X-31
ECHO 8. IBM X-60
set choice=
set /p choice=Please type in your choice and press enter.
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto IBM_T-40
if '%choice%'=='2' goto IBM_T-41
if '%choice%'=='3' goto IBM_T-42
if '%choice%'=='4' goto IBM_T-43
if '%choice%'=='5' goto IBM_T-60
if '%choice%'=='6' goto IBM_X-30
if '%choice%'=='7' goto IBM_X-60
if '%choice%'=='8' goto ExitScript
ECHO "%choice%" is not valid please try again
ECHO.
goto NAVTARGETMACHINETYPE
:PUSHFILES
XCOPY "C:\Windows\System32\devcon.exe" "\\%TargetMachineIP%\C$\Windows
\System32"
XCOPY "C:\Windows\System32\psexec.exe" "\\%TargetMachineIP%\C$\Windows
\System32"
GOTO NAVTARGETMACHINETYPE
:PUSHDISABLER
XCOPY "DisableNIC.bat" "\\%TargetMachineIP%\C$\Windows\System32"
CLS
GOTO REMOTELY_EXECUTE
:IBM_T-40
SET /p TargetNIC=*SUBSYS_25518086
GOTO WRITEDISABLER
:IBM_T-43
SET /p TargetNIC=*SUBSYS_27118086
GOTO WRITEDISABLER
:IBM_T-60
SET /p TargetNIC=*SUBSYS_10108086
GOTO WRITEDISABLER
:WRITEDISABLER
ECHO devcon disable >DisableNIC.bat
%TargetNIC% >>DisableNIC.bat
GOTO PUSHDISABLER
:REMOTELY_EXECUTE
psexec \\%TargetMachineIP% -u NA\%username% C:\Windows
\System32\DisableNIC.bat
PAUSE
GOTO ExitScript
:ExitScript
END