How can I start other (console) programs via one program made in masm? I want to make one program that will start another, and save info from it.
truthfully, go "hack" someplace else
hi,
Use CreateProcess() and pass a file-handle (CreateFile,OpenFile...) to STARTUPINFO.hStdOutput . The created Process (console-application) will write it output to the specified file.
regards, qWord
Hi nrdev,
Here is a quick example for you :
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
.data
app db 'C:\Windows\notepad.exe',0
.data?
startinfo STARTUPINFO <?>
processinfo PROCESS_INFORMATION <?>
.code
start:
invoke CreateProcess,ADDR app,0,0,0,0,0,0,0,\
ADDR startinfo,ADDR processinfo
invoke ExitProcess, 0
END start
you could also use shellexecute