Yes, that's it. I need to run a program .exe in the dos cmd line and it needs to run like when you right button and select "run as an administrator"
feedback
|
migrated from stackoverflow.com Feb 8 '10 at 9:42
This question came from our site for professional and enthusiast programmers.
|
Windows has a "runas" command that acts a bit like sudo does in Unix-y systems. Try typing "runas /?" in your command prompt. | |||
|
feedback
|
|
If you run cmd itself as administrator, everything else you run from there will also. I just setup a shortcut to the command prompt that opens as administrator. Everything from there is good to go. | |||
|
feedback
|
|
I have used a duo of .cmd & .vbs script called elevate, it works fine for my needs. All you need is to type elevate [command]from Start > Run or from the command line, and it will run the command with administrator privileges. Hope it helps! Here is elevate.cmd:
and elevate.vbs:
| |||||||||||||||
feedback
|
|
You have to use the RunAs.exe command. Here are some instructions: http://www.softtreetech.com/24x7/archive/53.htm | |||
|
feedback
|
|
You could also Press Windows Key, type CMD, this will list cmd in programs, right click it -> Properties -> Compatibility -> Run this program as an administrator This will always run as Admin. | |||
|
feedback
|
|
Since someone posted the VBS equivalent, here's a Invoke-Admin function for PowerShell
} | |||
|
feedback
|
|
In short:
In detail:
(1) Immediatly means typing it in the Search box, not in the Run box. | |||
|
feedback
|
|
I created a link from %SystemRoot%\system32\cmd.exe in the documents folder called cmd.lnk and then I clicked properties, advanced, then clicked always run as administrator or whatever. Then I removed the file %SystemRoot%\system32\cmd.exe from the index by right clicking on the cmd.exe program, going to properties, clicking advanced, and then unchecking Index this file for faster searching. I went to the start menu and typed indexing options and I am now rebuilding the index. It is going to take a while but I am almost positive that once the rebuild is finished, when I type cmd from now on, it will find the cmd link in the my documents folder and run that with administrative privileges and not show the cmd.exe from the system32 folder. Hope this helps. Spork | |||
|
feedback
|
|
Make a
| ||||
|
feedback
|