Windows 7 environment variable for System32 or SysWOW64

Is there an environment variable for direct access to the System32 or SysWOW64 , respectively, in Windows 7 32bit or 64bit?

I know a workaround using %WINDIR%\System32 which does not work for me.

I need to recompile an EXE that refers to some kind of OCX that needs to be registered in the System32 . The problem I am facing is that I have to install it on a 64-bit system, where OCX is registered in the SysWOW64 folder and not registered in the System32 .

What should I do? Thank you for your help!

Edit:

I realized that the solution has a link to a dll that references flash10h.ocx . To do this, flash10h.ocx must be registered. I could register it in the SysWOW64 folder, but not in System32 . My system already has a flash player v11.xx. Would it work?

Please, help!

+6
source share
1 answer

The following method will get the path to the 32-bit system directory and optionally put it in the SYSDIR32 environment variable.

 public static String Get32BitSystemDirectory (Boolean placeInEnvironmentVariable = true) { String sysDir = ""; if (Environment.Is64BitOperatingSystem) sysDir = Environment.ExpandEnvironmentVariables("%windir%\\SysWOW64"); else sysDir = Environment.ExpandEnvironmentVariables("%windir%\\System32"); if (placeInEnvironmentVariable) Environment.SetEnvironmentVariable("SYSDIR32", sysDir, EnvironmentVariableTarget.User); return sysDir; } 
+2
source

Source: https://habr.com/ru/post/955563/


All Articles