Runing console mode aplications 
Author Message
 Runing console mode aplications


> Hello,

> For running applications from a script, I use WSHShell.Run .
> With GUI mode aplication it works fine, but with console mode
> aplications, I cant retrieve the standard output of my aplication.
> What can I do ?

> This is my little script :

> Set Shell = WScript.CreateObject("Wscript.Shell")
> WScript.echo "I'm going to call rsdcdbid"
> error = Shell.Run ("rsdcdbid -n", 0, TRUE)
> if ( error <> 0 ) then
>   wscript.echo "Rsdcdbid failed. Error code : " & error
> end if

> It works fine. The database its created, but the message is lost.
> If i do :
> error = Shell.Run ("rsdcdbid -n > myfile.txt", 0, TRUE)
> the file myfile.txt its not created.

> Do you have answers ?

I believe you need to run your app in a secondary command processor, in
your case CMD.EXE.  If the process is to be used generally, you'll need
to access the environment and expand the COMSPEC variable to determine
which command processor is in use (COMMAND.COM or CMD.EXE or ???) and
where it is stored.  Command processors are not universally stored in a
location on the PATH, though they generally are.  As a quicky test try

 error = Shell.Run ("cmd.exe /c rsdcdbid -n > myfile.txt", 0, TRUE)

Tom Lavedas
http://www.*-*-*.com/ ~tglbatch/

Mon, 12 Mar 2001 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Getting input in Console mode

2. running console app in same console

3. Runing the Notepad in VBScript

4. Runing programs in WSH

5. install aplications

6. accessing a aplications class

7. Importing .ps files into MS Windows aplications

8. Going from PostScript mode to LaserJet mode on a KX-P4455

9. Stop aplications with WSH

10. Can I view the .ps file in the console mode?

11. How can I call a console app from WSH in same console?

12. gv under console


Powered by phpBB® Forum Software