scripts job permission question
Hello.
I tried run bat file using Scripts menu.
But this bat script can't work normally.
It cannot proceed any further at "echo Administrative permission request ..." stage.
I modify the permission in the script menu(Local System, Logged-in user, All logged-in users) , the result is the same.
So, I ran this bat file directly on my PC, it works normally.
What's wrong? Please help me.
=====================================================================================
@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo Administrative permission request ...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set params = %*:"=""
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
rem del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
@echo off
uwfmgr.exe filter enable
===============================================================================
Answers (0)
Be the first to answer this question