Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirection of executable's stardard & error output
#1
With the following command, from the DOS prompt, I can redirect the output of an executable to a DOS folder :

lstcat 2>&1 1>"C:\tmp\tzuni.txt"

However, I failed to execute this command through a QM macro. Primarily I used the statement'

run "C:\MSDEV\ses\spu\gamma\lstcat.exe" "2>&1 1>''C:\tmp\tzuni.txt''"

but it failed. I would appreciate any advice. Many thanks in advance.
#2
Try this:
Macro Macro33
Code:
Copy      Help
str cl="/c lstcat.exe 2>&1 1>''C:\tmp\tzuni.txt''"
run "%comspec%" cl "" "C:\MSDEV\ses\spu\gamma"
#3
Dear Start_Learning, thank you for your valuable information. Let me add that it looks like that your username should be upgraded!

My problem is more general and I will welcome any advice and/or suggestion. Being in a dialogue I need to run a Fortran .exe application to get some results to be further processed by the dialogue. I thought about using RunConsol2, however I failed inasmuch as it does not allow me to key input values to the Fortran. I appreciate any help, many thanks in advance.
#4
Could you be more specific by giving an example of what you would like to do in dialog in order to get the input you want and to create command line you want, so I could give you some more help if I could.
#5
Thank you once more! I have just managed to give an acceptable solution, as it follows. Best regards.

Function dialog57
Code:
Copy      Help
;www.quickmacros.com/forum/showthread.php?tid=6492&pid=31648#pid31648
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 25 11 48 14 "Run Exe"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,
,case 3
,opt waitmsg 1 ;;process messages while waiting
,wait 0 H mac("sub.Thread") ;;run code in other thread and wait
,
ret 1

#sub Thread

run "C:\MSDEV\SES\Spunal\exe\lstcat.exe" "C:\MSDEV\SES\Spunal\Config\param.dat"


Forum Jump:


Users browsing this thread: 1 Guest(s)