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

Comments

Please log in to comment

Answers

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. 

Answered 09/24/2013 by: archangel michael
Orange Belt

  • 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.
Please log in to comment
Answer this question or Comment on this question for clarity