I have an exe (I have the C# code for that also). I am invoking the exe in my vbscript application. Then I want to return a value from the exe and capture the value in my vbscript code. How can I do that?
-
possible duplicate of Return image from exeslugster– slugster2010-06-04 05:39:11 +00:00Commented Jun 4, 2010 at 5:39
-
why have you created a new account and asked virtually an identical question to what you asked yesterday?slugster– slugster2010-06-04 05:39:52 +00:00Commented Jun 4, 2010 at 5:39
-
@slugster: I think he's trying to implement one of the suggestions (from the comments: "have the exe return the file path via stdout and then the vbscript reads the output of the exe to get the path, then reads the file. – James Manning"). I'd say it's different enough ("what are my options in passing data between two programs"/"how to implement one of the options").Piskvor left the building– Piskvor left the building2010-06-04 05:55:33 +00:00Commented Jun 4, 2010 at 5:55
Add a comment
|
2 Answers
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("csharpprocess.exe")
Do While oExec.Status = 0
WScript.Sleep 100
Loop
WScript.Echo oExec.ExitCode
Reference:
http://msdn.microsoft.com/en-us/library/2f38xsxe%28VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/za76z6hh%28v=VS.85%29.aspx