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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to put content of directory into a file in HTA 1

Status
Not open for further replies.

barny2006

MIS
Mar 30, 2006
521
US
hi,
i'm trying to put contect of a folder (file list) into a text file using HTA/vbs to be used in a pull-down menu. i get an error msg when i use this code:
Code:
Set wshshell = WScript.CreateObject("WScript.Shell")
    wshshell.Run("cmd.exe /c dir c:\visdb data\*.* > c:\a_temp\test.txt")
is there anyway of doing this using filesystemobject or calling another vbs to do it?
 
Which error message ? On which line ?

You may try this:
Set wshshell = CreateObject("WScript.Shell")
wshshell.Run "cmd.exe /c dir ""c:\visdb data\*.*"" > c:\a_temp\test.txt"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i'm getting an error msg:
object required: 'wscript' on the first line.

i tried your suggestion:
instead of:
set wshshell = wscript.creatobject.....
i put:
set wshshell = createobject.......
and it worked a ok.
thanks phv



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top