Page 1 of 1

Using scripts on Win7

Posted: Fri Dec 09, 2011 3:25 am
by MerleOne
Hi,
I have created some scripts on my Win7 machine, but they need to be elevated to run properly or launched from an elevated cmd window. Is there a nice way to have them ask for elevation when launched ? Because it is rather cumbersome to manually launch an elevated cmd, then manually to the folder where they are then launch them. When I simply double-click on them using the explorer, there is no elevation and the image fails (it still creates a 2kb file which I have to clear in the backup folder).
Thanks.

Re: Using scripts on Win7

Posted: Sat Dec 10, 2011 4:08 am
by Alt
Right-click a bat file with the script and select Run as Administrator. A prompt will appear asking you to confirm that and the file will start with elevated privileges. If you're an administrator, of course.

Re: Using scripts on Win7

Posted: Sat Dec 10, 2011 5:27 am
by MerleOne
Thanks. I have done the following :
- created a script "mybackup.rdi" in C:\Scripts\
- created a .bat file containing
start "" c:\scripts\mybackup.rdi

Now, when I right-click on the .bat file within the explorer, and chose run as admin, it does work.

Next step is to have the same functionality using double-click, maybe by creating a shortcut to the .bat file.