title: How to retrieve correct path of either system32 or SysWOW64?
body: <p>I have a 32-bit process that can run either in 32-bit or 64-bit Windows. So, naturally, if the process tried to access the file <code>c:\windows\system32\file.ext</code>, it would be redirected to <code>c:\windows\SysWOW64\file.ext</code>. So far so good - I don't want to disable the redirection.</p>
  
  <p>My problem is that my process doesn't actually <strong>access</strong> the file - instead it just takes its path and <strong>writes it into a text file</strong>, and I want that text file to read <code>SysWOW64</code> on a 64-bit system, and <code>system32</code> on a 32-bit system. How can I do that?</p>