Fix: Powershell.exe is not a valid Win32 application

Powershell.exe is not a valid Win32 application

If you have a batch file or script calling the PowerShell application, you may receive an error that the PowerShell executable is no longer valid.

 

C:\Windows\system32\powershell.exe is not a valid Win32 application.

 

If you browse to C:\Windows\system32\powershell.exe, you may notice the PowerShell exe is a 0 byte file – clearly a corrupted version of PowerShell.

 

  1. Open Windows command prompt and type the following command
where powershell

 Where is windows powershell windows command line

 





  1. This should reveal where PowerShell exe is located. Update your scripts or batch files as necessary with the update location.
 

As for what happened to the originally PowerShell exe, it may have been due to recent system patching or updating.

* Please use the comment form below. Comments are moderated.*



Related Posts

 

Comments 1

Guest - booger on Thursday, 13 October 2022 13:29

there was probably a powershell.exe file created in the folder where cmd prompt is running from, as an error, and when windows tries to run that version, it is not a valid exe

there was probably a powershell.exe file created in the folder where cmd prompt is running from, as an error, and when windows tries to run that version, it is not a valid exe
Thursday, 28 March 2024