Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Running a PS script in batch file, disable UAC?

$
0
0

Hi,
I am trying to run the following command from a batch file:
PowerShell -NoProfile -ExecutionPolicy Bypass -Command “& {Start-Process PowerShell -ArgumentList ‘-NoProfile -windowstyle hidden -ExecutionPolicy Bypass -File script.ps1′ -Verb RunAs}”;
This will be run during an automated server deployment. When I run it manually I get the UAC prompt. Obviously the UAC is not something I want to turn off, unless it’s part of the batch file and I can turn it back on. Can someone help me with this?
Thanks!


Viewing all articles
Browse latest Browse all 13067