When I open the properties on a network connnection on windows, I see this dialog: Connection_Properties http://www.freeimagehosting.net/uploads/ca7a4d82ea.png
In this dialog, in the check-listbox I can enable or disable options like "File or printer sharing", "client for microsoft networks" or network filter drivers.
My question is: How can I enable/disable these options programatically? I didn't find anything that looks like this in the WMI documentation and I couldn't find any other Win32 API for this. I would prefer a C Win32 API or WMI interface, but a solution using any programming language is welcome. The question is language-agnostic.
I think INetCfg is what you're looking for:
http://msdn.microsoft.com/en-us/library/ff547694%28VS.85%29.aspx
Edit: Here's a link to a discussion where someone uses INetCfg to disable just File & Printer sharing.
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/b0407073-07bc-462b-9de9-7295be5fa183
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With