Page 1 of 1
Run 64Bit MSConfig from a batch File
Posted: 16 May 2022 01:16
by Interfacist
Greetings Gurus, I want to run the msconfig on a 64bit OS from a batch file.
Is there a way for the batch file to auto choose which exe is appropriate to run if there are 32bit and 64bit versions?
c:\>msconfig.exe
'msconfig.exe' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .
Re: Run 64Bit MSConfig from a batch File
Posted: 16 May 2022 03:56
by aGerman
Your batch file should be running in the 64bit cmd.exe process automatically on a 64bit system (unless you do funny business like wrapping it into a 32bit bat2exe thingy, or you changed the PATH environment to look for system tools in the SysWOW64 folder first). Thus, it should also find the right msconfig.exe. However, you can always call it by its full path, although folder names are virtualized. This means, if your current shell process is a 32bit process on a 64bit system, and you want to access the 64bit tools in the "system32" folder, you have to replace "system32" with the virtual folder name "sysnative" in the command line. (I know it's a little confusing
)
Steffen
Re: Run 64Bit MSConfig from a batch File
Posted: 16 May 2022 06:25
by Interfacist
I'm trying to run it from a 32bit program: Tried using an explicit path but that didn't work.
C:\Windows\System32\cmd.exe /Q /S /C msconfig.exe
Re: Run 64Bit MSConfig from a batch File
Posted: 16 May 2022 06:38
by Interfacist
Thanks for your help!
This worked, took me a minute to understand what you wrote, as you said (I know it's a little confusing
)
Using fully qualified path and SysNative
C:\Windows\
sysnative\cmd.exe /Q /S /C msconfig.exe
Re: Run 64Bit MSConfig from a batch File
Posted: 16 May 2022 09:54
by aGerman
Microsoft documented how file system redirection is implemented:
https://docs.microsoft.com/en-us/window ... redirector
Maybe this sheds some light on it.
Steffen
Re: Run 64Bit MSConfig from a batch File
Posted: 16 May 2022 20:50
by Interfacist
Thanks for that redirection reference as well.