Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Detect both File and Print Sharing Enabled

Keywords:     detect both File and Print sharing enabled

Question:

Do you happen to know any slick way to detect if a Win9x machine has both File and Print sharing enabled? Preferably a way that won't required any extenders.

I'm assuming there's gotta be some reg key to query.. But I can't find mention of one anywhere.

Answer:

If file/print sharing is installed then you will have these 2 new keys (actually.. several.. but we'll just stick to these for now)

File Sharing:

HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{3EFC0B01-F4AA-101A-8932-08002B327C2D}
Print Sharing:
HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{5F354881-1D7E-101B-A9DE-00AA0033819A}
You should be able to check the existence of either of the above.

However, those will both be there whether or not they are BOTH enabled. If one is enabled and the other isn't, then you will have the following keys/value:

Key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP

Value:

FileSharing="Yes" ("No" if it's not enabled)
PrintSharing="No" ("Yes" if it is enabled)

You could check for the existence of either/both.. if neither of the keys exists, then they are both enabled.

This is correct to the best of my knowledge.. I hope it's useful to someone.


Article ID:   W15272