Run vbs file from cmd peru

broken image
broken image
broken image

Wow, this article about VBS automatically run batch processing (BAT) file as an administrator is introduced here. Then naturally apply for the administrator.

broken image

The method to apply for authority is as follows:Ĭreate a runner, run the relative directory (relative directory is the directory to run batch processing) in the program, with administrator privileges. If it is rejected, you will have to apply for permission. If it is allowed, it is obvious that there are administrator privileges >nul 2>&1 '%SYSTEMROOT%\system32\cacls.exe' '%SYSTEMROOT%\system32\config\system'Įcho Set UAC = CreateObject^('Shell.Application'^) > '%temp%\getadmin.vbs'Įcho UAC.ShellExecute '%~s0', '', '', 'runas', 1 > '%temp%\getadmin.vbs'Īccess to a folder that requires authorization, such as (% systemroot% \ system32 / config / system)