Very short question here..what's the easiest way to simply execute a program by command line? As an example, if I just wanted to start cmd.exe or notepad.exe from a program (MASM32) how would I go about it?
Posted on 2001-03-04 14:17:00 by Aryss
bla db "notepad.exe",0 . . . invoke ShellExecute,NULL,NULL,addr bla,NULL,NULL,SW_NORMAL
Posted on 2001-03-04 16:35:00 by drcmda_
Hmm..oddly enough that didn't seem to work :> I tried this as a bare-bones test: .386 .model flat, stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\user32.inc include \masm32\include\shell32.inc includelib \masm32\lib\shell32.lib includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib .data bla db "notepad.exe",0 .code start: invoke ShellExecute,NULL,NULL,addr bla,NULL,NULL,SW_NORMAL invoke ExitProcess,NULL end start Any idea what I'm doing wrong?
Posted on 2001-03-07 15:55:00 by Aryss
Aryss, i don't call exitprocess. This must work (is for Tasm). .486 locals jumps .model flat,stdcall extrn ShellExecuteA :Proc .data URL db "notepad.exe",0 .code entry: call ShellExecuteA, 0, 0, offset URL, 0, 0, 1 sub eax, eax ret end entry Ciao ! TheTramp32
Posted on 2001-03-07 17:02:00 by TheTramp32
invoke CreateProcess, addr prog, NULL, NULL, NULL, FALSE,\ NORMAL_PRIORITY_CLASS, NULL, NULL, NULL, NULL
Posted on 2001-03-16 14:04:00 by koba