I can alternately right-click and set the exe to "run as administrator" in the compatibility properties. But when I pass the exe file on to another PC the run as administrator is gone.
Code: Select all
If WScript.Arguments.length =0 Then Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "wscript.exe", Chr(34) & _ WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1 Else 'Code here End If
Any other way I try to elevate UAC I somehow get into an endless loop.