
Windows/UAC - Launch another program not as administrator?
Re: Windows/UAC - Launch another program not as administrator?
@JHPJHP: The code you sent works: I get 2 x CMD.exe windows opened, the first elevated and the second, not. Thanks! 

Re: Windows/UAC - Launch another program not as administrator?
Tested ShellExecInExplorerProcess with:
It does the job, great 
Code: Select all
ShellExecInExplorerProcess("cmd.exe", "/C Whoami & Net Session 1>NUL 2>NUL && (Echo Run with elevated rights) || (Echo Run without elevated rights) & Pause")

Re: Windows/UAC - Launch another program not as administrator?
Hi BarryG,
Looks like you were already part of the thread back in 2020.
I not only agree with the previous posts, but tested it Six ways to Sunday and it seems to be a better solution for your requirements.
Definitely worth a second look
great job fryquez.
Looks like you were already part of the thread back in 2020.
I not only agree with the previous posts, but tested it Six ways to Sunday and it seems to be a better solution for your requirements.
Definitely worth a second look

If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Windows/UAC - Launch another program not as administrator?
Yeah, I totally forgot about that. I think something must be up with it that I discovered since, which is why I got initially excited with it but then had to abort it and ask again the other day. I'll do some tests to see why I gave up on it.