# Disabling/Enabling 'File and Printer Sharing' on a Network Connection through cmd



## DaveY625 (Nov 20, 2007)

I know how to enable/disable a firewall through command line. But how do I do the same for Files and Printer sharing on a network connection through cmd. This is for an xp workstation(s). 

Thank you for your help.


----------



## DaveY625 (Nov 20, 2007)

bump


----------



## IMM (Feb 1, 2002)

If it's SP2'ish, then perhaps something like:
_netsh set service type=FILEANDPRINT mode=DISABLE ..._
and so on for scope etc.
I don't know if you will also have to close the ports separately or not - or if you will want to clear the spooler with the utility in the tools addons.
http://technet.microsoft.com/en-us/library/bb490617(TechNet.10).aspx#ECAA


----------



## DaveY625 (Nov 20, 2007)

Thank you for your help!


----------

