Im maintaining a network with 1200 workstations on it and would like a script to display a list of the folders on the terminals so I can see if anyone has added any directory other than the standard image folders.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_Datafile"
For Each objFile in colFiles
Wscript.Echo objFile.Name
Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2"
Set colFolders = objWMIService.ExecQuery("Select * from Win32_Directory"
For Each objFolder in colFolders
Wscript.Echo objFolder.Name
Next
Regards
Steve Friday
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.