tags:

views:

183

answers:

3

Hi there

I have a cmd file that runs on 32 bit Vista system.

I notice that the code has references to the system32 driver folder.

I'm wondering whether the code could potentially run on a 64 bit Windows 7 system. So I guess my question is Does a 64 bit system contain a system32 folder?

Be very grateful for any replies.

A: 

Windows 7 64 bit has a System32 folder.

Whether your file will still run, however, is a more complex problem. It might, and depends entirely on what it relies on; if it's relying on drivers in the wrong way, it will fail as 32 bit drivers just don't work on 64 bit systems.

me_and
Thanks so much for taking the time to reply .. but when you say relying on drivers in the wrong way, what do you mean?
hmmlee
Without knowing more about the situation, I really can't say! If your code is relying on some technicality of a specific driver, that driver might be different under Win64, and so fails. Can you post the code in question?
me_and
+5  A: 

The System32 folder in 64-bit Windows actually contains the 64-bit files, and 32-bit programs running under WOW64 would generally go looking in System32 for the 32-bit DLLs etc. that they can call - but they'll find the 64-bit ones instead. Therefore the OS redirects all 32-bit applications' requests for the System32 folder to the SysWOW64 folder, which contains 32-bit system files.

ldigas
+2  A: 

Windows has a technology called WoW 64 (Windows-on-Windows 64-bit) that allows 32-bit applications (even compiled ones written in C/C++, etc.) to run on 64-bit Windows.

In addition to the System32 folder, a 64-bit Windows installation has a SysWow64 folder that has 32-bit versions of the files that you'll find in System32.

To be clear, references to System32 get redirected when running from a 32-bit process (unless the process disables this redirection, which is possible). As a result, if you have a .CMD file that references System32, it's actually going to read from the SysWow64 directory.

superoptimizer
Many thanks, I think I'm getting the picture. How do you know if your application is 32 bit?
hmmlee
Is this a command-shell script (.CMD file)? That's the impression I got from your post. If so it will execute anywhere, and I'm not certain what you meant by "references to System32", but I figured it was directly accessing files there.If this is a compiled application, and you have Visual C++ installed, you can use LINK /DUMP /HEADERS <file>.exe, and at the very top under FILE HEADER VALUES you'll see 'machine' with a name in parentheses. If it's (i386), then it's 32-bit. I forget what x64 lists, but it might be (x64) or (amd64).
superoptimizer