开发者

Running Batch Stript in Windows 7 causes process to be launched under wrong cmd process

开发者 https://www.devze.com 2023-03-04 23:17 出处:网络
Whenever I run a batch file on my comuter (64 bit architecture running 64 bit windows 7), the console window that is opened is running in 32-bit mode, a开发者_如何转开发nd checking the task manager co

Whenever I run a batch file on my comuter (64 bit architecture running 64 bit windows 7), the console window that is opened is running in 32-bit mode, a开发者_如何转开发nd checking the task manager confirms I am indeed running everything as a 32-bit process. I want to run the batch file under a 64-bit process, not a 32-bit process. I have changed the comspec environment variable to point to the proper variable, to no avail. Does anyone know how to fix this so that when I click on the batch file, it everything is run in 64-bit mode.

I realize I could simply open the 64 bit command window and run my batch file. However, this is a workaround and doesn't get at the root of the problem, and won't help when I give file to others.

Thanks, MM


Are the file associations for .cmd associated with the 32bit cmd.exe or the 64bit cmd.exe?


Can you run the scripts with the full path name to the executable? "C:\Windows\System32\cmd.exe" /c <batch_name> should run 64-bit "C:\Windows\SysWOW64\cmd.exe" /c <batch_name> would run in 32-bit

Otherwise, you could change the associations to run the extension .cmd with 64-bit (ftype cmdfile=C:\Windows\System32\cmd.exe /c "%1" %*) and .bat with 32-bit (ftype cmdfile=C:\Windows\SysWOW64\cmd.exe /c "%1" %*).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号