Hell again ASM community,

I have searched the forums for a very long time, and seen many examples on how to use the ShellExecute command, but I don't know why my code doesn't work!

Here is the important code:

cmd db "cmd.exe /k",0

DlgProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam: LPARAM
invoke LoadIcon,hInstance,barcode
invoke GetDlgItem,hWnd,1002
invoke SetFocus,eax
.elseif uMsg==WM_COMMAND
mov eax,wParam
.if eax == 1003
invoke GetDlgItemText,hWnd,1002,addr directory,256
invoke ShellExecute,NULL,NULL,addr cmd,NULL,addr directory,SW_SHOWNORMAL
invoke SetDlgItemText,hWnd,1004,addr newdir
.elseif uMsg==WM_CLOSE
invoke EndDialog,hWnd,0
xor eax, eax
DlgProc EndP

No matter what I cannot get cmd to execute! I tried it as the lpOperation as well with no luck. All the examples I have found are using the same syntax! Why isn't mine working? Can anyone tell me.

Thanks in advance.

Posted on 2010-04-01 17:13:21 by fel0n
You haven't specified a verb, try this:

szOpen DB "open",0
cmd DB "cmd.exe",0

invoke ShellExecute,NULL,OFFSET szOpen, OFFSET cmd,NULL,OFFSET directory,SW_SHOW
Posted on 2010-04-06 20:49:35 by donkey