jguinch Posted May 21, 2008 Share Posted May 21, 2008 Hi !I'm looking for a way to enum all mapped drives and connections etablished (like the Windows command net use [ENTER])I don't know how to use the _WinNet_EnumResource() function... Is there a way with it ?Thank you for your help... Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
spudw2k Posted May 21, 2008 Share Posted May 21, 2008 (edited) This info can also be found via WMI.http://msdn.microsoft.com/en-us/library/aa394220(VS.85).aspx$host = "." $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $host & "\root\cimv2") $colItems = $objWMIService.ExecQuery ("SELECT * from Win32_NetworkConnection") $conn = 0 For $objItem in $colItems $conn += 1 $info = "Name: " & $objItem.Name & @CRLF & "ConnectionState: " & $objItem.ConnectionState & @CRLF & "ConnectionType: " & $objItem.ConnectionType & @CRLF & "LocalName: " & $objItem.LocalName & @CRLF & "RemotePath: " & $objItem.RemotePath msgbox(0,"MAP " & $conn,$info) Next Edited May 21, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
jguinch Posted May 21, 2008 Author Share Posted May 21, 2008 Thank you very much ! I don't use WMI but it's very interesting ! Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now