sushant
sushant

Reputation: 943

Getting file list in a folder

I have created a tool which picks up a file from a specific location, copies it, zips it and then puts it at another location. The user has to select the required folders from the location.

Is there any way through which I can create an option in the tool so that the user can see the list of available folders at that location, or some way to direct the user directly to that location? I only need the folder names.

I tried it with cmd but since the location is not on my computer (it's on another computer with shared property) I dunno how to access that location. Any help, any hint is very much appreciated. My tool is in VBScript and ASP.

Upvotes: 1

Views: 19131

Answers (1)

dmb
dmb

Reputation: 603

You can use a FileSystemObject to get the contents of a directory.

set fso = CreateObject( "FileSystemObject" )
set my_folder = fso.getFolder( "C:\Example" )

Then, use the Folder object to get its contents.

set sub_folders = my_folder.subFolders
for each f in sub_folders
  wscript.echo( f.name & VBNEWLINE )
next

Upvotes: 2

Related Questions