Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm tring to create some directories (dirs) using a .bat file. At the cmd.exe, I can create the dirs normally, but when runing the commands inside a .bat file, for some odd reason, the dirs are created inside the SysWOW64 directory.

Win 7 x64 SP1 PRO

How can I tell Windows to create the dirs at the correct path?


mkdir C:\Windows\System32\oobe\info
mkdir C:\Windows\System32\oobe\info\backgrounds

Inside bat, results in: C:\Windows\SysWOW64\System32\oobe\info

Using a shortcut to cmd.exe and running it as administrator the dirs are still created inside SysWOW64. ex:

%windir%\system32\cmd.exe /c "D:\Test.bat"
%windir%\System32\runas.exe /user:Administrator %windir%\system32\cmd.exe /c "D:\Test.bat"

but if a open the cmd.exe manually as administrator and run the .bat file, it works! What a heck??

edit 2

I found out why. It is because I was running the .bat inside XYPlorer and not Windows Explorer (WE). Inside WE the .bat works. But a shortcut opened inside a 32 bit explorer is not able to run a 62 bit cmd.exe ?

share|improve this question
Open a run window, type in c:\windows\system32\cmd.exe and run your script from there. Does the script work as it should then? What if you run c:\windows\syswow64\cmd.exe and then run the script? – JSanchez Feb 25 '14 at 18:52
How can I make a bat do that? – Pedro77 Feb 25 '14 at 19:14
Use this command: c:\windows\system32\cmd.exe /c "name of your script" If this works, I can write an answer that will (hopefully) make your script launch the 64-bit command interpreter itself. Unfortunately, I don't have a 64-bit version of Windows on my computer to test this. – JSanchez Feb 25 '14 at 19:42
Just tried it on my system and I don't get the same behaviour... c:\windows\system32\cmd.exe /c "name of your script" is what my bat has for command line, so that should be it. – JasonXA Feb 26 '14 at 4:42
run the 64Bit CMD.exe, not the 32Bit one. – magicandre1981 Feb 26 '14 at 5:14
up vote 1 down vote accepted

If you are absolutely confident that writing folders in C:\Windows\system32\ is a good idea (probably not, but YMMV), and you don't want the File System Redirector to automatically redirect your file, and you must write with a 32-bit process, then use the path C:\Windows\sysnative\ and it will write out to the system32 folder.

Caution: it's probably not a great idea to go messing with these folders unless you fully understand what you are doing. Read the File System Redirector link a couple of times.

Also read this answer, as it's really great.

share|improve this answer
I fully understand what I'm doing. Changing windows default start/lock background. I did that a lot of times and need some automatization. Now I'm using Windows 10 and I like its background, lol. – Pedro77 Jun 17 at 12:47

The SysWOW64 is a feature in windows system folder structures and in windows registry. But this feature causes major problems for automation. Here's some info about the SysWOW emulator:

To work around this issue you need to either launch a 64bit version on command prompt or use MS's folder redirection.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.