I want to launch another executable file from a BAT file that I ran with administrator privileges without granting administrator privileges.
Hoge.bat
@ECHO OFF
START NOTepad
exit
If you run Hoge.bat with administrator privileges, Notepad will also be granted administrator privileges, so I would like to stop it.I would appreciate it if you could let me know if you could use PowerShell or an external tool.
powershell batch-file
If you specify 0x2000 as the trustlevel option in RUNAS, it appears that you can execute the command with general user privileges.
runas/trustlevel:0x20000 execution command
© 2024 OneMinuteCode. All rights reserved.