4

I have a powershell script. To run this sript, I have written a batch file.
Here is code of batch file:

:: psscript.bat
set psscript='%CD%\Hotfix-Automation-Installer.ps1'

echo Running PowerShell Script: %psscript%
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe ^&%psscript% %*

When I double-click on batch file, I want my script Hotfix-Automation-Installer.ps1 to be run as an administrator.
How I can run this script as administrator?

0

1 Answer 1

1

Read Matt's article on this link:
How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?

He has given complete script to elevate from current session to administrator session. Quiet helpful.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.