Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: OCX errors unless run as admin

29 Aug 2012   #1

Windows 7 Ultimate
OCX errors unless run as admin

I have a program that when run as a normal user throws errors about ocx's being missing or not correctly registered. I dont want to grant users admin to run it. It runs with admin privileges fine.

The thing is, once the program or a certain function has been run as admin that function will then run as a normal user. Why is this? Are files being registered as they are used?

Is it possible to ensure all the files in the WHOLE program folder are registered somehow if the intaller is not doing it properly? REGSVR or similar?

The program worked fine on Windows XP.

My System SpecsSystem Spec

29 Aug 2012   #2

Windows 7 Ultimate x64

OCXs are library files that contain controls and functions used by applications (technically called "ActiveX controls"). To use those functionality, the OCX must be "registered", that is, certain registry entries are created so the program can look it up and use it. Problem is that those registry entries are located under the HKEY_CLASSES_ROOT, which by default is writable only by administrators. So at least, the registration process must be run as admin. From then, every user can read and use the OCX.

It seems that the program is not registering the OCXs properly. Ideally, it should be done during install (which needs admin right anyway), but a buggy installer may fail to do this. In that case, the program may fall back to register on the very first use, which requires admin rights. After that first use, normal users can work normally. On XP with no UAC around, by default everyone is admin so it should work, but fail with a standard user.

Regsvr32 does precisely that registration process manually. You call it once for each OCX and DLL file on the program folder to ensure each one is registered. Note that it may fail for certain files, since it's only applicable on ActiveX components, so ignore all errors you get. Of course, you need to do that in an elevated command line.
My System SpecsSystem Spec
30 Aug 2012   #3

Windows 7 Ultimate

thanks for the reply, can some help with this batch file I want to run from an elevated command I can get it right:

for %a in ('dir C:\Program Files (x86)\Star\my program\*.dll') do regsvr32 /s %a
for %a in ('dir C:\Program Files (x86)\Star\my program\*.ocx') do regsvr32 /s %a

for %a in ('dir C:\Program Files (x86)\Star\my program\directory1\*.dll') do regsvr32 /s %a
for %a in ('dir C:\Program Files (x86)\Star\my program\directory1\*.ocx') do regsvr32 /s %a

My System SpecsSystem Spec


 OCX errors unless run as admin

Thread Tools

Similar help and support threads for2: OCX errors unless run as admin
Thread Forum
I need admin permission to delete/move file (but I'm both admin/owner) System Security
Solved WinUpdate made Admin act as no admin privileges available? Windows Updates & Activation
admin user lost some admin rights BSOD Help and Support
Boot errors,shutdown errors, wake errors. Performance & Maintenance
Admin acount no longer has admin privileges? General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 08:43 AM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33