Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


nothing running in Exec

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> nothing running in Exec
  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 >>
 nothing running in Exec - 7/8/2008 8:19:15 PM   
  garfunkal

 

Posts: 25
Score: 0
Joined: 3/5/2008
Status: offline
hiya

I have a peice of code that runs a bat file - it runs lovely using the run method - but i need to use stdout - so I altered it to exec.
Initially i had problems which i assumed where to do with the stdout processing i added, so i commented it out - but still an issue.
If i run in cscript the control passes almost immediatly back to the cmd line - if i run in wscript it opens up an empty command window but hangs - neither acually runs the bat!

can anyone suggest where i am going wrong? i am using 5.6 so it isnt that exec isnt on the install!  I know in Run i can look at the output - but i suppose in exec I cant do that.

cheers for any help - code below (only the pertinent processing)

andrew


Dim fso,   objshell
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("wscript.shell")

'Set objShell = WScript.CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("D:\Infogix\Assure\usi-data\Scripts\AISMI_Infogix_RunCP_Utility_CA.bat")
'Do While Not objExecObject.StdOut.AtEndOfStream
'
'                    strResults = objExecObject.StdOut.ReadAll
'
'                       'If InStr(1, strResults, "Control Point Return Code: 16", vbTextCompare) Then
'   If InStr(1, strResults, "Control Point Return Code", vbTextCompare) >0 Then
'                    wscript.echo "Exit Code= 16  " & strResults
'      end if
'loop

wscript.quit

 
 
Post #: 1
 
 RE: nothing running in Exec - 7/8/2008 10:57:24 PM   
  garfunkal

 

Posts: 25
Score: 0
Joined: 3/5/2008
Status: offline
in addition - i fear that the .bat isnt compatable with the stdout(etc) or worse still i cant run this particular bat with exec-  I can get a response from other .bats - is it noramly for them to be incompatable?

< Message edited by garfunkal -- 7/8/2008 10:58:42 PM >

(in reply to garfunkal)
 
 
Post #: 2
 
 RE: nothing running in Exec - 7/9/2008 12:25:34 AM   
  ebgreen


Posts: 5041
Score: 31
Joined: 7/12/2005
Status: offline
Could you post the bat?

_____________________________

"... 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 garfunkal)
 
 
Post #: 3
 
 RE: nothing running in Exec - 7/9/2008 1:02:53 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
Try

Set objExecObject = objShell.Exec("cmd /c D:\Infogix\Assure\usi-data\Scripts\AISMI_Infogix_RunCP_Utility_CA.bat")

_____________________________

Rischip
Author of - The Grim Linker

(in reply to garfunkal)
 
 
Post #: 4
 
 RE: nothing running in Exec - 7/10/2008 9:55:24 PM   
  garfunkal

 

Posts: 25
Score: 0
Joined: 3/5/2008
Status: offline
the bat in hither:

ECHO off
c:
cd C:\Infogix\Assure\InfogixAssure\dist-stage\server-util\
set CLASSPATH=
echo afterclasspath

call RUNCP -entity AISMI_CustAcct_Mart_Commission_Extract -point CustAcct_Commission -ds

(in reply to Rischip)
 
 
Post #: 5
 
 
 
  

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 >> nothing running in Exec 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