Run Windows Applications In Elevated Mode (UAC Prompt) sudo for Windows 7

So how do you get a batch file to run as an elevated user? For example, I have a batch file that will copy the contents of an XP user’s profile to a Windows 7 user’s profile. The only catch is that the Windows 7 user profile structure is different, and the batch file must be run elevated in order to read the junctions so as to not fail the copying. So how do you do this without having the user right click and “Run as Administrator”? Elevation PowerToys for Windows Vista 7. This file contains a ton of useful scripts for the admin, or even the average power user. I can’t believe this has been out since June 2008 and i’m only finding it now! Great tool without having to use the runas command, or play with a Power Shell script. This will most certainly be deployed on all my future Windows 7 machines! The two key files in this package are:
  1. elevate.cmd (+)
  2. elevate.vbs (+)
The CMD is a simple batch file that will pass arguments into the VBS file. The VBS file will prompt the end user with the typical UAC prompt to allow or cancel, or display a usage box if no arguments are specified. I only made one slight modification, since I would always be launching this from a Run or Command window. I changed the last line in the batch file to read: I dumped these two files in my C:\WINDOWS\SYSTEM32 directory, and renamed them to SUDO.CMD and SUDO.VBS. I no longer need the Start++ application for the sudo command!
sudo for Windows 7

Leave a comment

Your email address will not be published. Required fields are marked *