Kaseya Community

execute file as administrator

  • ok so i have a setup.exe file that when i run it from a command prompt it has to run cmd as an elevated "administrator mode" in order for it to work correctly. it does run as long as i runas administrator

    in my kaseya script, i have it setup to execute a file in a directory and it is set to run as system. I would think it would run but it does not.

    does anyone have a script/syntax they could share with me how to make the file run as administrator.

  • you can use the Use Credential option in the procedure to use the Administrator Credentials stored in Kaseya ... applied to the agent via the Agent or Audit tabs.

  • For Windows 7 and above you can also use:

    powershell.exe -Command "Start-Process [path\file] -Verb RunAs"

    where [path\file] is the path and file name you want to run.

    I've used this with .cmd files to run executive and other complex commands that require an elevated command prompt to work correctly.