Add Comment
|
Related Links
|
TrackBack
Run As Administrator (GPL)"RunAsAdministrator.cmd" is Windows batch program that elevates a script or program to admin level. This script does the same thing as you right-clicking on a program and select "Run as administrator", except it allows you to do it from the command-line or within a batch script. "RunAsAdministrator.cmd" takes advantage of the following batch files. They are also available on this web site. So to use "RunAsAdministrator.cmd", you'll have to download these other batch scripts, if you don't already have them. GetTempPathName.bat "RunAsAdministrator.cmd" is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site. If you make changes to this batch file, please feel free to upload it back here to share it with others. Usage"RunAsAdministrator.cmd" "program" [ "arg 1" . . . "arg N" ] Chieh Cheng Looks like I forgot to attach the batch script. It is now attached below. Chieh Cheng Found a single character typo that causes this script to fail in obscure cases. I've updated the script. New version is attached below. Chieh Cheng While fixing the single character typo bug, I saw a possible improvement to the script. So I decided to implement it. Now the script takes a new optional argument, allowing you to specify the window mode for the elevated command execution. The new version of the script is attached. And the following is the new usage page. Usage"RunAsAdministrator.cmd" [ /w mode ] "program" [ "arg 1" . . . "arg N" ] ExamplesThe following runs the command in a hidden window: > RunAsAdministrator.cmd /w 0 echo hello The following runs the command in maximized window: > RunAsAdministrator.cmd /w 3 echo hello Chieh Cheng Made two minor enhancement. One is adding debug functionality. Two is making it more concurrent with other instances. New version is attached below. Chieh Cheng Improved the parameter handling routine so that parameters can now contain the '&' character. Chieh Cheng
Add Comment
|
Related Links
|
TrackBack
Did your message disappear? Read the Forums FAQ. TrackBackTrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites. Send Ping | TrackBack URL | Spam Control Title: Has Administrator Privilege (GPL) Add CommentSpam Control | * indicates required field Messages, files, and images copyright by respective owners. |
Products
|
Services
104 Users Online
|
Copyright © 1996 - 2024. All Rights Reserved. |