Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Shell exec vs Run Command

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,30885
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Shell exec vs Run Command
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Shell exec vs Run Command - 2/9/2006 8:40:20 AM   
  sparks70b

 

Posts: 1
Score: 0
Joined: 12/2/2005
Status: offline
I have the following code that works OK

Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("ftp -s:" & chr(34) & strFTPScriptFileName & chr(34))
Set objStdOut = objWshScriptExec.StdOut

 While Not objStdOut.AtEndOfStream
    strLine = objStdOut.ReadLine
       WScript.Echo strLine
Wend


It ftp's a file to a server.  I want to capture the logfile generated to the variable strline.  When i use the "run Command" It seems to capture more information than when I use the Exec command.  The exec command only seems to capture the commands I issue and none of the commands the server issues.  I could use the run command but the exec seems to be easier to work with.  Any ideas?

Thanks in advance,

Randy
 
 
Post #: 1
 
 RE: Shell exec vs Run Command - 2/10/2006 2:51:00 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
i didnt even know you could do that!


/runs off to modify a few scripts

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to sparks70b)
 
 
Post #: 2
 
 RE: Shell exec vs Run Command - 2/10/2006 3:09:19 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
How do you capture information from the .Run method? I was not aware that you could grab StdOut from .Run.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to kirrilian)
 
 
Post #: 3
 
 RE: Shell exec vs Run Command - 2/10/2006 3:31:29 AM   
  DiGiTAL.SkReAM


Posts: 1170
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
You can't capture the StdOut from a .Run command.  However, you CAn redirect it into a text file and then parse the text file...

ShellExec has some limitations... for example, there is no way of hiding the dosbox that it displays on your screen.

_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to ebgreen)
 
 
Post #: 4
 
 RE: Shell exec vs Run Command - 2/10/2006 3:52:14 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Ya, I knew about redirecting, the op just made it sound like he was getting the StdOut interactively.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 5
 
 RE: Shell exec vs Run Command - 2/10/2006 7:06:36 AM   
  DiGiTAL.SkReAM


Posts: 1170
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to ebgreen)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Shell exec vs Run Command Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts