Web Development

General discussion


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.


This conversation is currently closed to new comments.

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

Related Discussions

Related Forums