/build/static/layout/Breadcrumb_cap_w.png

Run batch file through vbs script using 'Run as administrator' command inside the vbs script

Hi all,

Is it possible to run a batch file from within a VBS script using the 'Run as administrator' from the right click menu on Windows 8? Is there a command line to call this particular command? I'd rather not be storing my local admin password within the file, as well.


0 Comments   [ + ] Show comments

Answers (1)

Posted by: archangel michael 10 years ago
Orange Belt
1

IF you run the VBS from an elevated account, it should run the batch file as that user with that elevated account as well. If you're running this VBS via another process, you need that process to run as a local administrator using something like the local computer system account. This usually requires an agent or something similar on the local system.

Bascially, if you don't want to embed credentials in the VBS, you'll need to run the VBS from an Administrator level account. 


Comments:
  • Most shops tend to use a service account for stuff like this but, if you don't control that area, you might want to consider using ADS - Alternate Data Streams. http://support.microsoft.com/kb/105763

    Not ideal, since your credentials still end up in a file but combined with, say, an MD5 hash of your password, it might be a useful pro temp hack. - anonymous_9363 10 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ