If your batch contains net use * /d /y, all the net use mappings, will be deleted.
To delete all the printer mappings made with the net use command, include the following in your batch:
for /f "Skip=4 Tokens=2" %%i in ('net use') do @if not "%%i"=="command" @if not "%%i" LSS "LPT1" @if not "%%i" GTR "LPT9" net use %%i /d
0 comments
Hide comments