2008-07-02, 03:25 AM
I thought I'd share this script I found on the net a while back on this link
http://blogs.msdn.com/aaron_margosis/arc...vista.aspx
Basically if you save the code as elevate.js in your path, it lets you run programs at a elevated admin level in vista, sort of like a sudo command in linux.
For example to get an administrator command prompt, assuming you are running as Administrator, it's just
Start->Run->elevate.js cmd
It comes in handy from time to time and I've never had to turn UAC off.
Martin
http://blogs.msdn.com/aaron_margosis/arc...vista.aspx
Basically if you save the code as elevate.js in your path, it lets you run programs at a elevated admin level in vista, sort of like a sudo command in linux.
For example to get an administrator command prompt, assuming you are running as Administrator, it's just
Start->Run->elevate.js cmd
Code:
// elevate.js -- runs target command line elevated
if (WScript.Arguments.Length >= 1) {
Application = WScript.Arguments(0);
Arguments = "";
for (Index = 1; Index < WScript.Arguments.Length; Index += 1) {
if (Index > 1) {
Arguments += " ";
}
Arguments += WScript.Arguments(Index);
}
new ActiveXObject("Shell.Application").ShellExecute(Application, Arguments, "", "runas");
} else {
WScript.Echo("Usage:");
WScript.Echo("elevate Application Arguments");
}
It comes in handy from time to time and I've never had to turn UAC off.
Martin