>OCX files usually physically reside in the System or System32 subdirectory. How can I find out under program control where the OCXs reside? (The platform is VFP 6.0 and WinNT/4.0 or Win95 or Win98.)
>
If all you need is the location of the Windows system directory for a given machine, the Win32 API call GetSystemDirectory() works regardless of the platform. I've posted the code for this several times in the past couple of weeks.
If you have WSH installed on the system, the system directory can be gotten from the SpecialFolders collection of the Wscript.Shell Automation object.
>I need to know this because: if the program determines that an active x control is not registered, the program has to copy the ocx file from the server to the workstation, and the program has to know to which subdirectory to copy the ocx.
>
>Let's assume the program knows where to find the ocx on the server.
>
>Another question: on my WinNT/4.0 machine, I have ocxs in both the System and the System32 subdirectory. Why is this? It seems WinNT would want them in just one subdirectory.
>
Actually, as long as the .OCX has ben registered on the system, Windows doesn't much care about the directory it's in - the exact location of the currently registered version of any given OLE Server or ActiveX control is stored in the registry.
>Thanks, Chaim