Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a build script which runs within visual studio. As part of the script i need to register a DLL with regsrv32, however this needs to be done with elevated privileges.

When we did this under XP, since all users on our domain are local administrators, regsrv32 always succedded, however under Windows 7 it fails as the script runs with the standard user privileges.

I looked at using RunAs, however this doesn't seem to work correctly, and only runs as the account specified, not the current user with elevated privileges.

Does anybody know of a way of elevating a single command within a script?

share|improve this question

1 Answer 1

Did you get an answer off-line? RunAs doesn't work in Win7 either, even if you create another user as a member of Administrators, because he still needs to be "elevated". Sysinternals ShellRunAs has an "enumerate priviledges" option which only lists one "Basic User", even in an elevated command window - useless!


PS The only workaround I could find was to set the batch-file's shortcut to "Run as Administrator" though the resultant elevation dialog is annoying.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.