Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Displaying Folders and Files within the drives

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,693
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Displaying Folders and Files within the drives
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Displaying Folders and Files within the drives - 9/18/2002 4:11:14 AM   
  sim_andrew

 

Posts: 1
Score: 0
Joined: 9/18/2002
From:
Status: offline
Hi everyone,
Appreicated any advice given ....
I am using a bat file to pass in the parameters into the VBScript. Which is "C:"
Now I would like to display all folders and files within "C:"
I understand i can use "getFolder" or "getFiles" method, but this will restrict me of diaplaying all folders and files in the "C:" And i must display the path, name of the files / folders before i could retrieve them.

So in conclusion, is there any methods where i can list all folders and files in "C:"

Thanks in advance !
 
 
Post #: 1
 
 Re: Displaying Folders and Files within the drives - 11/2/2002 7:51:47 AM   
  sfriday

 

Posts: 5
Score: 0
Joined: 9/4/2002
From: United Kingdom
Status: offline
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_Datafile Where Drive = 'C:'")
For Each objFile in colFiles
Wscript.Echo objFile.Name
Next

Regards
Steve

(in reply to sim_andrew)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Displaying Folders and Files within the drives Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts