How can i run program under cursor as admin?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: How can i run program under cursor as admin?

Post by *Fla$her »

KozakMak wrote: 2023-02-20, 14:34 UTCbat - do nothing
ps1 - open in notepad
Corrected the parameters.
Overquoting is evil! 👎
KozakMak
Senior Member
Senior Member
Posts: 364
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: How can i run program under cursor as admin?

Post by *KozakMak »

exe - work, other - doesn't
OS: Win10 | TC: latest x64
Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: How can i run program under cursor as admin?

Post by *Fla$her »

Because it should be done via cm_CommandBrowser, not ini, where additional quotes are needed around the parameters.
Overquoting is evil! 👎
KozakMak
Senior Member
Senior Member
Posts: 364
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: How can i run program under cursor as admin?

Post by *KozakMak »

exe - ok
bat - start HIDEN elevated cmd
ps1 - nothing

¯\_(ツ)_/¯
OS: Win10 | TC: latest x64
Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: How can i run program under cursor as admin?

Post by *Fla$her »

Maybe the problem is in the ps1 code? powershell.exe doesn't it appear in the process list?
Overquoting is evil! 👎
KozakMak
Senior Member
Senior Member
Posts: 364
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: How can i run program under cursor as admin?

Post by *KozakMak »

just one line - Get-Process

doesn't appear
OS: Win10 | TC: latest x64
Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: How can i run program under cursor as admin?

Post by *Fla$her »

Add the line $host.ui.RawUI.ReadKey(6).ch to the end of the code and check the presence of the process in the list again.
Overquoting is evil! 👎
KozakMak
Senior Member
Senior Member
Posts: 364
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: How can i run program under cursor as admin?

Post by *KozakMak »

appear
OS: Win10 | TC: latest x64
Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: How can i run program under cursor as admin?

Post by *Fla$her »

I.e. as a result, everything works.
Overquoting is evil! 👎
KozakMak
Senior Member
Senior Member
Posts: 364
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: How can i run program under cursor as admin?

Post by *KozakMak »

Fla$her wrote: 2023-02-21, 16:23 UTC I.e. as a result, everything works.
noop

Code: Select all

TOTALCMD#BAR#DATA
*%COMMANDER_PATH%\Utils\NirCmd\nircmd.exe execmd
"(if /i "%E"=="bat" (%V) else if /i "%E"=="cmd" (%V) else if /i "%E"=="ps1" (powershell.exe -nol -noni -nop -ex Bypass -f %V) else start "" %V)&"~$nir.exefile$" win postmsg foreground 1075 540"
%COMMANDER_PATH%\TOTALCMD64.EXE,3
nircmd
%COMMANDER_PATH%\Utils\NirCmd\

-1
create .bat file with this and run - shows nothing

Code: Select all

echo test
pause
I want this behavior in ONE command without flashing:
1) exe bar cmd - run as admin
2) ps1 - powershell -ExecutionPolicy Bypass -NoExit -File %P%N
OS: Win10 | TC: latest x64
Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: How can i run program under cursor as admin?

Post by *Fla$her »

KozakMak wrote: 2023-03-29, 10:22 UTCI want this behavior in ONE command without flashing:
Without flashing, but with the console displayed? And what's the point of NirCmd then? :?
Overquoting is evil! 👎
KozakMak
Senior Member
Senior Member
Posts: 364
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: How can i run program under cursor as admin?

Post by *KozakMak »

okey, lets start from begging :D

I'm using two command:

Code: Select all

[em_startelevated]
cmd=%COMMANDER_PATH%\Utils\NirCmd\nircmd.exe
param=elevate %P%N
and

Code: Select all

[em_psrun]
cmd=*%COMMANDER_PATH%\Utils\NirCmd\nircmd.exe
param=execmd start powershell -ExecutionPolicy Bypass -NoExit -File %P%N
first one I use on CAS+ENTER and second one on CA+S=em_psrun. They both work ok and without cmd flashing, just calling UAC.

The goal is unite then. So the question is - how do that using nircmd (or else)?
OS: Win10 | TC: latest x64
Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: How can i run program under cursor as admin?

Post by *Fla$her »

KozakMak wrote: 2023-03-29, 16:09 UTCparam=elevate %P%N
Why do you need to run all files with elevated permissions? It's stupid.
And why are you still not using %AMD%?
Overquoting is evil! 👎
KozakMak
Senior Member
Senior Member
Posts: 364
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: How can i run program under cursor as admin?

Post by *KozakMak »

Fla$her wrote: 2023-03-29, 16:28 UTC It's stupid.
actually it's pretty convenient! Ctrl+Alt+Shift+Enter = run elevated!
Fla$her wrote: 2023-03-29, 16:28 UTC And why are you still not using %AMD%?
:?: :?: :?:
OS: Win10 | TC: latest x64
KozakMak
Senior Member
Senior Member
Posts: 364
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: How can i run program under cursor as admin?

Post by *KozakMak »

ok you got me intrigued with %AMD% (wtf is this) but question can be closed, since now we had swag option and call menu for ps1
OS: Win10 | TC: latest x64
Post Reply