General discussion

Locked

Shared Session data with VB6 + WMI?

By dstoltz ·
I'm using VB 6 on Windows XP Pro -
I need to know how to grab the "Shared Folders Sessions" collection. (This can be viewed on XP by right clicking my computer, click manage, then shared folders, sessions)

I've been told I can use WMI in VB6 to do this, but I don't know where to find the code....please provide code to grab this collection info. I need VB to do it, not a VBS script file.

Thanks!!!

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by tcolgrove In reply to Shared Session data with ...

Win32_ServerConnection will show you that information. It's properties include .ComputerName, .ShareName, .UserName

'--------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSessions = objWMIService.InstancesOf("Win32_ServerConnection")
For Each Connection In colSessions
'Put your code here
Next

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums