Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to list folders on network computers

Status
Not open for further replies.

stavros0

IS-IT--Management
Jan 14, 2002
25
GB
Hi,

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.

Any takers?

Thanks

S
 
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 can be the name of a remote computer

you can view these examples on technet scripting


beware - this script may take sometime and could fail if it runs out of memory.

There are other examples such as enumerating folders etc

Regards
Steve Friday
 
here is the folder one.

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top