Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Will doing "Run as administrator" on a .BAT file allow regsvr32 enough privlieges to register a DLL or OCX?

The .bat file contains:

regsvr32 -u SomeOCX.ocx
regsvr32 SomeOCX.ocx

Or, does the logged in user need to be an administrator?

share|improve this question

3 Answers 3

"Run as administrator" should provide sufficient permissions if the user account can use that function.

share|improve this answer
    
When would a user account not be able to use a function? –  CJ7 Jun 4 '10 at 8:11
    
@Craig Johnston If the account is not an administrator, and if the user does not know the name and password of an administrator account, they will not be allowed to run applications as an administrator. If the account is not an admin account, they will be asked for valid credentials with which to run the .bat file. –  Darth Android Jun 4 '10 at 13:56
up vote 1 down vote accepted

There can be difficulties with running .BAT files if you need it to run with administrator access. If right-clicking on the .bat file and choosing run as administrator doesn't work, then try starting an elevated command prompt and running the .bat file from there.

share|improve this answer

Even if run from an account with administrator privileges (except for The built-in administror account), you will still need to use "run as administrator" to elevate the batch file, because of UAC restrictions. If you will be distributing this batch file or just want to make the process automatic, you may want to check out the Elevation powertoy, which lets you put lines in a batch file to cause it to be automatically elevated and prompt the user accordingly.

share|improve this answer
    
How do domains affect this? Is there the possibility that "Run as administrator" will elevate to domain-administrator and not local-administrator? –  CJ7 Jun 6 '10 at 6:44
    
It will elevate to whatever account you choose. When a computer is a member of a domain, the UAC credentials dialog will prompt you for a username and password; you can choose a local or domain administrator. –  nhinkle Jun 6 '10 at 16:53

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.