Search code examples
powershellbcdedit

Powershell cant understand "bcdedit"


When I try to run in CMD bcdedit command is working. When I try to run it in PowerShell I get this: The term 'bcdedit' is not recognized as the name of a cmdlet But in manuals and tutorials bcdedit working fine in PowerShell. Why my PowerShell did not recognize bcdedit?

System: Windows 7 x64 SP3


Solution

  • There are two versions of powershell.exe, one 32-bit and one 64-bit.

    In the 32-bit version, the path C:\windows\system32 actually refers to C:\windows\SysWOW64.

    bcdedit.exe only exists in the "real" 64-bit system32 and cannot be found in a 32-bit powershell console.

    To determine which version of powershell you are running you can run this command:

    PS C:\> [intptr]::Size
    4
    

    On a 32-bit console the size is 4 and on a 64-bit console the size is 8.