Enable or Disable File and Printer Sharing with snetcfg.exe
Command I Used To Enable File and Printer Sharing
snetcfg.exe -c s -u MS_Server
snetcfg.exe -c s -i MS_Server
The first line above uninstalls File and Printer Sharing and the second reinstalls it. This ensures that File and Printer Sharing is installed and enabled. After the software was deployed I removed the second line from the start up script and File and Printer Sharing was once again disabled.
SNETCFG Command Line Help:
C:>snetcfg /?
snetcfg [-v] [-l
-i
where,
-l provides the location of INF
-c provides the class of the component to be installed
p == Protocol, s == Service, c == Client
-i provides the component ID
The arguments must be passed in the order shown.
Examples:
snetcfg -l c:\oemdir\foo.inf -c p -i foo
...installs protocol 'foo' using c:\oemdir\foo.inf
snetcfg -c s -i MS_Server
...installs service 'MS_Server'
OR
snetcfg [-v] -q
Example:
snetcfg -q MS_IPX
...displays if component 'MS_IPX' is installed
OR
snetcfg [-v] -u
Example:
snetcfg -u MS_IPX
...uninstalls component 'MS_IPX'
OR
snetcfg [-v] -s
where,
-s provides the type of components to show
a == adapters, n == net components
Examples:
snetcfg -s n
...shows all installed net components
OR
snetcfg [-v] -b
Examples:
snetcfg -b ms_tcpip
...shows binding paths containing 'ms_tcpip'
General Notes:
-v turns on the verbose mode
-? Displays this help
Hope this helps some people... feel free to comment...
Justin



