Run 64Bit MSConfig from a batch File

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Interfacist
Posts: 7
Joined: 03 Mar 2022 23:52

Run 64Bit MSConfig from a batch File

#1 Post by Interfacist » 16 May 2022 01:16

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 . . .

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Run 64Bit MSConfig from a batch File

#2 Post by aGerman » 16 May 2022 03:56

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 :lol:)

Steffen

Interfacist
Posts: 7
Joined: 03 Mar 2022 23:52

Re: Run 64Bit MSConfig from a batch File

#3 Post by Interfacist » 16 May 2022 06:25

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

Interfacist
Posts: 7
Joined: 03 Mar 2022 23:52

Re: Run 64Bit MSConfig from a batch File

#4 Post by Interfacist » 16 May 2022 06:38

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 :lol:)
Using fully qualified path and SysNative
C:\Windows\sysnative\cmd.exe /Q /S /C msconfig.exe

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Run 64Bit MSConfig from a batch File

#5 Post by aGerman » 16 May 2022 09:54

Microsoft documented how file system redirection is implemented:
https://docs.microsoft.com/en-us/window ... redirector
Maybe this sheds some light on it.

Steffen

Interfacist
Posts: 7
Joined: 03 Mar 2022 23:52

Re: Run 64Bit MSConfig from a batch File

#6 Post by Interfacist » 16 May 2022 20:50

Thanks for that redirection reference as well.

Post Reply