Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

bypass UAC when running powershell script from 3ds Max

$
0
0

Hey, guys!

I very new to powershell scripting, but I found that I need to use it.

I solved everything that I need with ps1, but the problem is with UAC now.

In maxscript I use the code as follows to run ps1, and it runs the script with UAC promts:


PHP
local ShellPath = "C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe" local procInfo = dotnetobject "System.Diagnostics.ProcessStartInfo" ShellPath procInfo.Arguments = "-noprofile -executionpolicy bypass -File " + "\"" + ShellFile + "\"" procInfo.Verb = "runas" -- run as administrator procInfo.useShellExecute = on -- run as administrator procInfo.CreateNoWindow = on  procInfo.WindowStyle = (DotNetClass "System.Diagnostics.ProcessWindowStyle").Hidden -- hide console local DotNetHandle = dotnetclass "System.Diagnostics.Process" local SharingProcess = undefined try  (...

Viewing all articles
Browse latest Browse all 15370

Trending Articles