I have a batch script (that I'm running as a .cmd file through the right-click Send To menu) that first disables a user's Internet adapter, then securely unzips a .zip archive.
For most people, it's working great, but I have a couple users who are getting a 'System cannot find the drive specified' error, when there's nothing in there that is looking for a drive.
netsh interface set interface name="Local Area Connection" admin=disabled
if "%errorlevel%" == "0" (
echo Network Interface disabled
::netsh interface set interface name="Wireless Network Connection" admin=disabled
::if "%errorlevel%" == "1" (
::echo Network Interface still active, exiting
::pause
::exit \b
::)
) ELSE (
echo Network Interface still active
pause
exit \b
)
There are some commented out pieces, if the user only has one active Internet connection. The output these two users are getting is:
Network Interface disabled
The system cannot find the drive specified.
The system cannot find the drive specified.
The system cannot find the drive specified.
Network Interface still active
So even aside from the fact that I'm not looking for a drive, it shouldn't be able to echo Network Interface disabled AND Network Interface still active at the same time, right?
EDIT: I'm pretty sure it's because I have :: comments inside an IF block. Apparently that's not cool with Windows batch scripting.