flat assembler
Message board for the users of flat assembler.

flat assembler > Windows > Problem with Shellexecute

Author
Thread Post new topic Reply to topic
SC0U7



Joined: 20 Feb 2018
Posts: 12
Hello i have exe with elevated admin right i try runing cmd.exe also elevated from this exe but i dont know why isn t cmd running as Admin any suggestion?

Code:
invoke ShellExecute,NULL,NULL,'cmd.exe','timeout 5 & pause ',NULL,SW_SHOW     


But it doesn t work
Post 28 Mar 2018, 15:28
View user's profile Send private message Reply with quote
Hrstka



Joined: 05 May 2008
Posts: 12
Location: Czech republic
Use CreateProcess instead of ShellExecute.
Post 29 Mar 2018, 12:58
View user's profile Send private message Reply with quote
SC0U7



Joined: 20 Feb 2018
Posts: 12
I try also CreateProcess but i think it also don t work as Admin i try this


Code:
mov [StartupInfo.cb],sizeof.STARTUPINFO
        mov [StartupInfo.wShowWindow],0
        mov [StartupInfo.dwFlags],STARTF_USESHOWWINDOW+STARTF_USESTDHANDLES
        mov [StartupInfo.hStdInput],eax
        mov [StartupInfo.hStdOutput],eax
        mov [StartupInfo.hStdError],eax
        push ProcessInfo
        push StartupInfo
        push 0
        push 0
        push 0
        push TRUE
        push 0
        push 0
        push pp
        push 0
        call [CreateProcess]    


And this is my variable :

Code:
pp db  ' cmd.exe /C cd %windir% & timeout 10 & pause',0    


Any ideas ? How to Run it elevated from elevated exe?
Post 29 Mar 2018, 16:13
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1603
Location: Ukraine
try this:
Code:
cmdl: db '/C timeout 5 & pause',0
exec: db 'cmd.exe',0  
...
    invoke ShellExecute,NULL,NULL,exec,cmdl,NULL,SW_SHOW
    

_________________
UNICODE forever!
Post 30 Mar 2018, 09:57
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2018, Tomasz Grysztar.

Powered by rwasa.