I have a mostly wired network in my home. My laptop however usually connects via wireless. Because of the wireless connection, I've always had issues with re-connecting network drives on startup. So, I've written a batch file that runs on login that will map my network drives only after the wireless card has automatically connected to my home network and the gateway address is accessible. I recently had to wipe my laptop (stupid vista blue screen) and up until that point, my script was working like charm. Now, after net use commands, I am receiving "The network connection could not be found" errors and I can't figure out why. I hope someone can offer some input. You can ignore many of the echo's as I'm just as much into looks as I am into functionality
echo Waiting for wireless connection....
Ping 127.0.0.1 -n 2 > nul
ipconfig |find /i "192.168.0.1" >nul
if errorlevel 1 goto waitloop
echo Connected Successfully!
echo Disconnecting Previous Network Drives
net use W: /delete
net use X: /delete
net use Y: /delete
net use Z: /delete
echo Reconnecting Network Drives
net use w: \\192.168.0.146\Volume_1 /persistent:no
net use X: \\192.168.0.150\C /persistent:no
net use Y: \\192.168.0.150\F /persistent:no
net use Z: \\192.168.0.150\External_G /persistent:no