Link to home
Start Free TrialLog in
Avatar of Emmel
Emmel

asked on

Shell Command

Hey, using the 'shell' command is it possible to list the contents of a folder i.e. using Shell"C:WINDOWS/" and then list the contents of the windows folder. Any suggestions how to do this?
Avatar of aelatik
aelatik
Flag of Netherlands image

Not with the shell command, try

Dim fname, Myval
fname = Dir("C:\WINNT\*.*")
Do While fname > ""
   Myval = Myval & fname & vbCrLf
   fname = Dir
Loop
MsgBox Myval
In your case it would be :

Dim fname, Myval
fname = Dir("C:\WINDOWS\*.*")
Do While fname > ""
   Myval = Myval & fname & vbCrLf
   fname = Dir
Loop
MsgBox Myval
ASKER CERTIFIED SOLUTION
Avatar of DrTech
DrTech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CleanupPing
CleanupPing

Emmel:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?