Run-Time Error 75 Issue in Windows 7 and Vista


I had a Windows application created "for-hire" several years ago (when XP was the dominant OS). The application was coded in VB6 and runs perfectly in XP. But in Vista and 7, however, it frequently hits a "Run-Time Error 75: Path/File Access Error" at startup.

When my users hit this error, I've been giving them a "band-aid" fix by telling them to right-click on the icon and "Run as Administrator." Now that nearly everyone is using Windows 7, I'm encountering that problem far too often and I want a permanent fix instead of a band-aid.

I think the problem is related to the 3 ActiveX files that the application accesses. As it stands now, these three OCX files are installed in C:\Windows\system32 by default (and registered as well). The three OCX files are:


All of the other auxiliary files are installed in the same folder as the executable, so I don't think they are the problem. Other than that, the application uses some true-type fonts that are included with the installation.

There's got to be an easy way to fix this so I don't have to keep telling my users to "Run as Administrator." Can anyone help me?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Right click on the shortcut > Properties > Advanced > check the box "Always run as administrator > OK > Apply > OK
Do you have Windows 7 to use for debugging? The first thing you would want to do is debug on Windows 7. If you don't have access to Windows 7 then you can create a Standard(Limited) account on Windows XP this would be almost identical to the permissions enforced in Vista and later with UAC. Run your code on the limited account and check at which lines it's throwing exceptions .. Here is what you need to look for in your source code for the cause of the errors.

 Check all file operations.
 Check all operations that access the system registry.
 Check all hard-coded paths to locations you don't have write access (Program Files), C:\
 Check all operations that use the Dir() function for possible causes. You don't have permission to access a specific directory.
 The user profile locations have changed on Vista and later make sure you use SHGetSpecialFolderPath() for special locations such as the All User directory.
 When writing files use the All User AppData or All User directories.
 When accessing the registry for *WRITE access only HKEY_CURRENT_USER has read/write access rights. HKEY_LOCAL_MACHINE access rights has *READ permissions only unless running under administrative privileges.
Error 75 would have nothing to do with where the OCX's are located, you'd get a different error number for that. I have 26 VB6 programs that put the OCX's you mentioned plus many more in C:\Windows\system32, and I also register them. My code hums along without a complaint on anything from XP up to Win7 64-bit.

I think your path/file error is coming from somewhere else. Windows 7 is pretty picky about where you can place and change files now. It doesn't like you fooling around in "Program Files" as much as Windows used to. Plus many other folders. I get around this by doing what I've always done...make a folder directly off the root of C drive and place my program there. I can create, change, delete, etc all files with impunity.

If I were you, I'd look at your code and see what are the first file operations you are doing, and where those files are located.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
garyknightAuthor Commented:
Installing the program on the root of the C drive fixed it. Thanks!!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.