Kaprice
asked on
Run regsvr32 from VBA as Admin with or without a password
My Access deployment uses a 3rd party ActiveX control which requires registering with regsvr32 as Admin.
I found this code which works IF the Admin user has a password:
This opens cmd.exe window with a prompt for the admin password but errors out if you just press Enter because there is not Admin password.
On my client machines, I can't guarantee there will or will not be an Admin password so I need code that will allow me to register the DLL whether there is a pw or not.
Ideas?
I found this code which works IF the Admin user has a password:
shell "runas /user:administrator " & zmagic.Strings.WrapInQuotes(strControlDLL, 2), vbNormalFocus
This opens cmd.exe window with a prompt for the admin password but errors out if you just press Enter because there is not Admin password.
On my client machines, I can't guarantee there will or will not be an Admin password so I need code that will allow me to register the DLL whether there is a pw or not.
Ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I wasn't sure how to grade this. It wasn't the answer I was hoping for, meaning the answer doesn't solve my problem, so a B or C seemed appropriate. But, the answer does appear to be accurate, meaning there really is no solution to my question, other than the 3rd party tools mentioned in the answer.
So, I chose "A" (Excellent) since it's not the Expert's fault that VBA or Windows does not provide a way to do what I wanted.
Thanks for your help on this.
So, I chose "A" (Excellent) since it's not the Expert's fault that VBA or Windows does not provide a way to do what I wanted.
Thanks for your help on this.
c:\regsvr32.exe c:\SomeFolder\sample.ocx
Does this work form the command prompt?
If so, then you can wrap it in code and run it from VBA