/build/static/layout/Breadcrumb_cap_w.png

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


===============================================================================


0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ