Using scripts on Win7

Forum on data and disk backup and restore, partition imaging and cloning, and drive copy.
Forum rules
Discussion on the R-Drive Image software

Using scripts on Win7

Postby MerleOne » Fri Dec 09, 2011 3:25 am

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.
MerleOne
 
Posts: 43
Joined: Fri Jan 30, 2009 12:11 pm

Re: Using scripts on Win7

Postby Alt » Sat Dec 10, 2011 4:08 am

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.
Alt
Site Moderator
 
Posts: 2186
Joined: Tue Nov 11, 2008 2:13 pm

Re: Using scripts on Win7

Postby MerleOne » Sat Dec 10, 2011 5:27 am

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.
MerleOne
 
Posts: 43
Joined: Fri Jan 30, 2009 12:11 pm


Return to Data Backup and Restore

Who is online

Users browsing this forum: No registered users and 2 guests