/build/static/layout/Breadcrumb_cap_w.png

Need help running a batch file as admin

I am trying to run a batch file as local system that uninstall previous Revu versions. I ran it both as a batch file and and also tried uploading it as a dependency. Tried to run it as System, Logged in user, with admin credentials. The batch file gets copied to the system but fails to run.. But if I go to the file and run it as an admin, it runs.


What am I missing or how can I run it as admin?


1 Comment   [ + ] Show comment
  • Hi,
    What's the error message? - egiberne 3 years ago

Answers (2)

Posted by: ewoywood 3 years ago
White Belt
0

Try using double percent symbol for every variable.

I remember when we put a Bat in a script (not as dependency file,  as a part of a task), we'd need to do this.


( i don't know why, but when whe create a new script, the option "run a batch file" isn't available.

Y7jGU8iG7qAAAAAElFTkSuQmCC

)

First, we copy an existent script  that run a batch file, and then paste the entire batch code in the script

x+6jp04c+N6zwAAAABJRU5ErkJggg== OdBlTagzNkKgDi3aQgACEIAABAZGACEwsIAyHQhAAAIQgEAdAgiBOrRoCwEIQAACEBgYAYTAwALKdCAAAQhAAAJ1CCAE6tCiLQQgAAEIQGBgBBACAwso04EABCAAAQjUIXAPv2rSn181IRbEghwgB8gBcqDtHLjno48+Ej4wIAfIAXKAHCAHxpkDCAGEEEKQHCAHyAFyYMQ58P8BosKyLq4YtkoAAAAASUVORK5CYII=

Save and try.

Option 2
kAAAAASUVORK5CYII=



 

Posted by: rileyz 3 years ago
Red Belt
0

Are you using variables that expand that path in the batch file? When running as SYSTEM, not all varibles are available to the batch environment. Test it with a hard path.

Also, test the batch with psexec. This allows you to test as SYSTEM.

the command is psexec -s -i cmd

you need to get it from systernals (ms download).


Comments:
  • I am not sure. But here is one of the commands in the batch file, its calling msiexec.exe

    REM Uninstall Bluebeam Revu 19.0.5 x64:
    SET GUID={59C37150-DACB-42B2-8AD7-ADC59F9FDBEA}
    REG QUERY %UNINSTALLKEY%\%GUID%>nul 2>nul
    IF "%ERRORLEVEL%"=="0" msiexec.exe /x %GUID% /qn

    If I have to use psexec, wouldn't I have to put that on all the systems I am trying to run the batch on? - bozadmin 3 years ago
 
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