Quote:
> I have a script that will FTP a bunch of files from another machine into
> a local machine. I then want to concatenate all these files into one and
> open it in Excel. I can do the concatenation in DOS with a "copy *.txt
> total.txt" command. But how do I call this command from within the .VBS
> file? Or is there a way from within a batch file to launch a .VBS file?
> --
> Jim Ryan
> Please CC: by mail
You can do either: issue the COPY from the script or run a script from a
batch.
To use the COPY (a full batch is not really needed), you can use the
WSHShell.RUN method, something like this ...
set oWS = WScript.CreateObject("WScript.Shell")
Cmd = "%comspec% nul /c copy d:\pathspec\*.txt d:\pathspec\total.txt"
oWS.Run Cmd, 0, True
See the WSH documentation for more info on Run.
Or you can run the script via the Wscript.exe or cscript.exe interface,
something like this ...
wscript d:\pathspec\yourscript.vbs
If you have additional steps in the batch procedure that are to be
executed AFTER the script is completed, use START /W to launch the
script ...
start /w wscript d:\pathspec\yourscript.vbs
Type START/W at a command prompt for more info.
Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/