using old fortran code in dos
using old fortran code in dos
(OP)
Old question I think but I cannot find an answer.
I have an old fortran code that runs fine in a Dos window.
The code asks several questions interactivaly. I want to
create a UNIX like .com file to answer these questions automatically. I have looked into VBscripting but cant seem to figure it out. I can launch the fortran code but cant get the script to accept any of my answers.
Dim oShell,oExec
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run("C:\mycode.exe" )
??? now what????
Thanks for any help!
Mark
I have an old fortran code that runs fine in a Dos window.
The code asks several questions interactivaly. I want to
create a UNIX like .com file to answer these questions automatically. I have looked into VBscripting but cant seem to figure it out. I can launch the fortran code but cant get the script to accept any of my answers.
Dim oShell,oExec
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run("C:\mycode.exe" )
??? now what????
Thanks for any help!
Mark
RE: using old fortran code in dos
CODE
const app = "C:\mycode.exe"
set dos = CreateObject ("WScript.Shell")
dos.run app
' Wait for the process to be active
WScript.sleep 1000
while dos.appactivate (app) <> vbTrue
WScript.sleep 500
wend
' Talk to it
Send "100", 200
' More sends as required
' ...
' Terminate
WScript.Quit
sub Send (pin_str, pin_delay)
dos.sendkeys pin_str
' Give the program a chance to recover
WScript.sleep pin_delay
end sub
RE: using old fortran code in dos
MyProg < MyAnswers.txt
RE: using old fortran code in dos
I will try these things.
Denial,
I didnt know you could redirect.
That could be another solution.
Thank you,
Mark