Call a batch file. 
Author Message
 Call a batch file.

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


Fri, 30 Aug 2002 03:00:00 GMT  
 Call a batch file.

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/



Sat, 31 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. calling a batch file from script

2. Calling a batch file

3. call a batch file from Access

4. Calling a batch file?

5. Newbie: Calling a batch file

6. calling a batch file

7. Can Autorun call a batch file???

8. Logon Batch to call a VBS that calls another batch

9. HELP! Call Script from a batch file

10. Call VBScribt with parameter from DOS Batch file

11. calling batch files

12. batch file called from ASP

 

 
Powered by phpBB® Forum Software