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
bilbonvidia

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
Alejandro85

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
bilbonvidia

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

pause
My System SpecsSystem Spec
.

Reply

 OCX errors unless run as admin




Thread Tools




Similar help and support threads
Thread Forum
Installing New Graphics Card Driver / Admin Errors
OS:Windows 7 Home Mother Board: GA-880GMA-UD2H PCI-Express x1 PCI-Express x16 slot (PCIEX16) PCI-Express x16 slot (PCIEX4) PCI Slot Power Supply: 500w CPU: AMD Atholon(tm) II X4 640 Processor (4 CPUs), ~3.0Ghz
Graphic Cards
Admin wants to share a directory with non-admin users
There is a user, Dad, with admin privileges on a Windows 7 machine (this is me). There are other users, kid1 and kid2, with no admin privileges (my kids ;-) ) I want to let kid1 and kid2 access the contents of a directory in my userspace C:\Users\Dad\ . In fact it's not at the top level,...
General Discussion
I need admin permission to delete/move file (but I'm both admin/owner)
Hi, I'm new to Windows 7. I'm still trying to master the file permissions.. I need some help and I'd appreciate it if someone could help me out. I have a folder with mp3s (created with my old Windows XP system). I've included this mp3s folder in the "my music" library and then I inspected...
System Security
admin user lost some admin rights
I can't delete a file from the desktop. When I try, it says to get the rights from the specified admin user (which I'm logged on). The strange thing is that I still can create other users from this account (including admins). Any suggestion on what to do?
BSOD Help and Support
Boot errors,shutdown errors, wake errors.
Wake from sleep is slow and I loose control over curser for 10 sec. These are most of the errors and their numbers that I have been getting over the past 5 days. Boot duration 100,101,109,103 Stanby duration 300 Driver caused delay 351 Thumbdrive driver delay
Performance & Maintenance
Admin acount no longer has admin privileges?
Hi. The main (and only account) I have been using since the first beta came out had administrator privileges. Today when I booted up I noticed that my account could no longer do things that are associated with an admin account, such as installing certain programs and writing to certain...
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 20:55.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App