Link to home
Start Free TrialLog in
Avatar of RXCTO
RXCTO

asked on

How to find Windows' System directories from 32 bit EXE running on both 32 and/or 64 bit OS

I have a .NET 3.5 application written in C# which needs to copy files to *BOTH* the windows' system folders.   It has some 32 bit DLLs which need to go in the system32 folder and it has 64 bit DLLs which need to go in the 64 bit System folder.  

So, basically i need to figure out how to write these methods:

public string Get32BitWindowsSystemFolder()
{

}

public string Get64BitWindowsSystemFolder()
{

}
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

you will run into problems as you should be using the appdata folder or programdata folder as the windows directory is a protected area. There is only 1 system32 folder which contains both 32bit and 64 bit executables.
Avatar of RXCTO
RXCTO

ASKER

My program is following the instructions to install "Java Access Bridge" from Oracle.  The instructions say to copy some of the files to the System32 folder and others to the SysWOW64 folder.  What am i supposed to do?

see Table 2-2 in the instructions.

http://docs.oracle.com/javase/accessbridge/2.0.2/setup.htm
actually I had misspoken earlier:
system32 contains the 64 bit dll's
syswow64 contains the 32 bit dll's

The copying routine must run with elevated privileges (run as administrator) to access these protected areas
SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RXCTO

ASKER

The other comment only works for .NET 4.  My question specified .NET 3.5.   My solution works for .NET 3.5