Hi Jeff,
I think there is no easy way to do it programmatically. You may try to If
you search "file and printer sharing" enable wmi in google groups, you can
find a lot of hits on this topic. From the link, we will find one tool
named Snetcfg can be used to get close to it.
I also searched in our internal database and found the following
information for you:
You can control file and printer sharing bysetting
hklm\system\currentcontrolset\services\class\vxd\v netsup FileSharing - AND
- PrinterSharing.
One must first make sure that "VREDIR" and "VNETSUP" are installed. You can
do this with IPNEW. There is a Client ID string for vredir, you will need
to create a new one for Vnetsup. Set the string value of the registry
entry to "On" to allow the specified sharing and "Off" to disable the
specified sharing option.
You can install one tool named regmon from
www.sysinternals.com to monitor
registry value's change.
For how to install "file and printer sharing", please refer to one DDK
sample IPNEW on the Win98 DDK. It can be used to do that.
In fact, this question is better asked in DDK group since this function on
Win9X is implemented in DDK.
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.