0

In the options, I choose Custom shell and point to C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe. But it still launches 32-bit powershell for me. What should I do for now?

6
  • 1
    Are you sure you're running a 64-bit system? According to at least one article and my personal testing on Windows 7 64-bit that would appear to be the correct path. See also this and this for further information.
    – Seth
    Feb 6, 2017 at 8:03
  • @Seth, yes, I'm pretty sure that I'm in a 64-bit system. I use [Environment]::Is64BitProcess command to determine if a powershell session is 64 or 32 bit. Only Github Desktop makes it wrong.
    – Elderry
    Feb 6, 2017 at 8:41
  • 1
    Is the GitHub Desktop executable a 32-bit or 64-bit one? Maybe, if it is a 32-bit one, the mapping changes dynamically?
    – Seth
    Feb 6, 2017 at 9:34
  • Use C:\Windows\Sysnative instead of C:\Windows\System32 to bypass file system redirection as @Seth already linked to How to launch 64-bit powershell from 32-bit cmd.exe.
    – JosefZ
    Feb 6, 2017 at 15:55
  • @Seth merits reward…
    – JosefZ
    Feb 7, 2017 at 7:04

1 Answer 1

0

GitHub Desktop seems to be a 32-bit application. As you're running it on a 64-bit system Windows changes certain paths and environment variables in the background using file system redirection. This also happens e.g. for the registry. Both is done in order for the 32-bit application to find the files it needs in the appropriate places.

So while a 64-bit application launching C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe would start a 64-bit PowerShell a 32-bit application would launch a 32-bit PowerShell. If you go ahead an check the question "How to launch 64-bit powershell from 32-bit cmd.exe?" you will find that you should be able to use a path that references sysnative instead of system32 in order to launch a 64-bit application from a 32-bit application. So you would reference:

%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe

This isn't working for me on Windows 7 64-bit though it should be available for systems since Vista.

This article seems to have a bit more information about the whole thing and this article as some more in depth information about side effects if you opt to disable the redirection.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .