GTKINC
asked on
Is there a way in my current login script to delete any printers/drive mappings before its starts with the new ones?
This question is pretty straight forward. Is there a way in my current login script to delete any printers/drive mappings before its starts with the new ones? I'm running a SBS 2K3 server. Thanks in advance.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To delete all drive mappings and printer mappings to LPT ports from a batch file without knowing the mappings
net use * /delete /y
hth
Steve
net use * /delete /y
hth
Steve
ASKER
i'm using the .bat file. They are ran when the users log in. Their batch files depend on what group they are in. Hope this helps.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is the line needed to delete any printers/drive mappings
bye Gastone Canali
::
:: rm-net-mappings.cmd
:: *** delete any printers/drive mappings ***
::
:: *** remove all network disk mappings
net use * /del /y
:: Turn off persistence
net use /persistent:no
:: *** remove all network printer mappings
reg delete HKCU\Printers\Connections /f
:: *** end
bye Gastone Canali
::
:: rm-net-mappings.cmd
:: *** delete any printers/drive mappings ***
::
:: *** remove all network disk mappings
net use * /del /y
:: Turn off persistence
net use /persistent:no
:: *** remove all network printer mappings
reg delete HKCU\Printers\Connections /f
:: *** end
::
:: rm-net-mappings.cmd
:: *** delete any printers/drive mappings ***
::
:: *** remove all network disk mappings
net use * /del /y
:: Turn off persistence
net use /persistent:no
:: *** remove all network printer mappings
reg delete HKCU\Printers\Connections /f
:: *** end
again ...
net use * /del /y
net use /persistent:no
:: more elegant way to remove mapped printer
WMIC /INTERACTIVE:Off PRINTER where network='TRUE' delete
Bye Gastone
net use * /del /y
net use /persistent:no
:: more elegant way to remove mapped printer
WMIC /INTERACTIVE:Off PRINTER where network='TRUE' delete
Bye Gastone
ASKER
Thanks for your time.
there are a few ways of doing this depending if you know what printers they are likley to have.
read http://www.computerperformance.co.uk/Logon/Logon_Remove_Printer.htm
this will send you in the right direction.
Regards
Andrew