Error: spawn powershell ENOENT

I installed Heroic and it was all fine, then uninstalled and reinstalled it at some point, now getting this error, and can't seem to access GoG library, only Epic. I definitely have Powershell installed, just launched it. I'm posting a log and a screenshot of my environment variables if that helps.
67 Replies
sensitive-blue
sensitive-blueOP5mo ago
No description
deep-jade
deep-jade5mo ago
There was an error that was patched recently because it calls the profile of your own powershell instead of defaulting to no profile. Basically any modification to your powershell like adding an environment variable causes this issue. We patched it by adding the -NoProfile argument to the powershell commands within Heroic not sure if it's in release yet?
sensitive-blue
sensitive-blueOP5mo ago
I have Heroic 2.15.2 HOTFIX #2 installed, then I guess I wait for the patch to go through. Thank you!
CommandMC
CommandMC5mo ago
ENOENT actually is a different error (it does mean Heroic is unable to find PowerShell) What happens when you open a command prompt and run powershell? Does it launch?
sensitive-blue
sensitive-blueOP5mo ago
if I type powershell, it displays this message, however PowerShell is present on my system, I just launched it with its icon.
No description
CommandMC
CommandMC5mo ago
Most likely your local %PATH% env var is screwed up somehow (the screenshot above is showing the system variable) In that same command prompt, run echo %PATH% and take another screenshot
sensitive-blue
sensitive-blueOP5mo ago
No description
CommandMC
CommandMC5mo ago
Hm, that looks normal enough What does dir C:\Windows\System32\WindowsPowerShell\v1.0\ say?
sensitive-blue
sensitive-blueOP5mo ago
No description
CommandMC
CommandMC5mo ago
Yup that's in there How odd
sensitive-blue
sensitive-blueOP5mo ago
sorry, one line got left out of the screenshot: Volume in drive C has no label. I don't know if that matters
CommandMC
CommandMC5mo ago
That's fine, just wanted to confirm that the powershell.exe executable was in that folder I assume running C:\Windows\System32\WindowsPowerShell\v1.0\powershell brings up powershell?
sensitive-blue
sensitive-blueOP5mo ago
no actually
No description
sensitive-blue
sensitive-blueOP5mo ago
but I have powershell installed:
No description
CommandMC
CommandMC5mo ago
Right, it won't spawn a new window, it'll just create the prompt in the existing one
sensitive-blue
sensitive-blueOP5mo ago
and the weird thing is, Heroic had been installed and was working fine no, it won't launch powershell like this
CommandMC
CommandMC5mo ago
PowerShell has launched in that window. You can tell by... well, the output text, and the "PS" at the start of your prompt (the PS C:\Users\Zed) So it is indeed where it's supposed to be & working fine, now I just gotta find out why it's not detected even though it's on %PATH%
sensitive-blue
sensitive-blueOP5mo ago
alright!
CommandMC
CommandMC5mo ago
I don't expect this to be an issue, but what does echo %PATHEXT% say?
sensitive-blue
sensitive-blueOP5mo ago
shall I relauch CMD prompt?
CommandMC
CommandMC5mo ago
You'll have to exit the nested PowerShell by running exit once first (alternatively just re-launch CMD, yes)
sensitive-blue
sensitive-blueOP5mo ago
No description
CommandMC
CommandMC5mo ago
Right, that looks normal I've also just tested your %PATH% env var on a test system, which still made it find PowerShell correctly. So something else is up What does where powershell say? It should output C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe, and not INFO: Could not find files for the given pattern(s).
sensitive-blue
sensitive-blueOP5mo ago
it's the latter INFO: Could not find files for the given pattern(s).
CommandMC
CommandMC5mo ago
Alright, let's try something Open up a new command prompt (you can close the existing one if you want to). In that new prompt, run set "PATH=C:\Windows\System32\WindowsPowerShell\v1.0\", then try running powershell again. Does it launch?
sensitive-blue
sensitive-blueOP5mo ago
No description
sensitive-blue
sensitive-blueOP5mo ago
it didn't launch just as PS within CMD
CommandMC
CommandMC5mo ago
Yeah sorry, that's what I meant
sensitive-blue
sensitive-blueOP5mo ago
ah, ok
CommandMC
CommandMC5mo ago
So the problem is somewhere in that variable... Time to give it a 3rd look Just to explain this, this is somewhat of a "Where's Waldo" thing where you find a misplaced semicolon or quote character in your PATH variable. And I have yet to find it
sensitive-blue
sensitive-blueOP5mo ago
gotcha, let me know what you need from me
CommandMC
CommandMC5mo ago
Could you send me the output from here as text (you'll have to re-run that command in a new command prompt window)?
sensitive-blue
sensitive-blueOP5mo ago
hmm when I enter echo %PATH%, this comes up: C:\Windows\System32\WindowsPowerShell\v1.0\
CommandMC
CommandMC5mo ago
(I should note, selecting text with the left mouse button and then right-clicking it copies it)
you'll have to re-run that command in a new command prompt window
sensitive-blue
sensitive-blueOP5mo ago
ah yeah, sorry I realized it
C:\Program Files\Python311\Scripts;C:\Program Files\Python311;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%SYSTEMROOT%\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\Users\Zed\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Steam\steamapps\common\DSX\Main_v3_Beta;C:\Users\Zed\AppData\Roaming\npm;
sensitive-blue
sensitive-blueOP5mo ago
can the hightlighted line be a problem with the slash at the end?
No description
CommandMC
CommandMC5mo ago
That's fine, other paths in there also have a trailing slash This might seem a little bone-headed, but could you try
set "PATH=C:\Program Files\Python311\Scripts;C:\Program Files\Python311;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%SYSTEMROOT%\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\Users\Zed\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Steam\steamapps\common\DSX\Main_v3_Beta;C:\Users\Zed\AppData\Roaming\npm;"
powershell
set "PATH=C:\Program Files\Python311\Scripts;C:\Program Files\Python311;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%SYSTEMROOT%\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\Users\Zed\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Steam\steamapps\common\DSX\Main_v3_Beta;C:\Users\Zed\AppData\Roaming\npm;"
powershell
Just to confirm that doesn't work
sensitive-blue
sensitive-blueOP5mo ago
what should I look for?
CommandMC
CommandMC5mo ago
PowerShell shouldn't start after that (the variable contents there are the same that are currently set)
automatic-azure
automatic-azure5mo ago
just to be sure, is it complaining about powershell not being found, or about the gogdl.exe executable not being found? cause I've seen some new reports of antiviruses flagging gogdl with false positive lately
sensitive-blue
sensitive-blueOP5mo ago
No description
CommandMC
CommandMC5mo ago
PowerShell's not found. If the error would be anything after it, it'd look different
automatic-azure
automatic-azure5mo ago
like, does this file exists? C:\Users\Zed\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\x64\win32\gogdl.exe
CommandMC
CommandMC5mo ago
Huh, that's interesting Could you try removing the first entry here (& rebooting after that)?
sensitive-blue
sensitive-blueOP5mo ago
actually it didn't start automatically, I pressed enter again, because poweshell prompt was already there shall I do it again this time without pressing enter 2x?
CommandMC
CommandMC5mo ago
PowerShell's prompt can be a bit weird sometimes. That's not a concern, the point here is that CMD is now able to find PS, even though we didn't modify the variable
sensitive-blue
sensitive-blueOP5mo ago
yes
No description
sensitive-blue
sensitive-blueOP5mo ago
Removed it and rebooted launched Heroic, same error
CommandMC
CommandMC5mo ago
Right, would've been too easy Are you able to launch executables from other folders on your PATH? Do wmic, git, and node all run?
sensitive-blue
sensitive-blueOP5mo ago
by on my path you mean first I need to get on my path? How to do that? because by simply typing wmic, it's not recognised
CommandMC
CommandMC5mo ago
The folders those executables are in should already be on your PATH (system PATH to be exact) So you should be able to just open up command prompt and run them
sensitive-blue
sensitive-blueOP5mo ago
okay, let me send a screenshot
CommandMC
CommandMC5mo ago
Alright, so there's a larger issue here That's, uh... bad? But also good, since we now know where to look
sensitive-blue
sensitive-blueOP5mo ago
git and node works, wmic returns this:
'wmic' is not recognized as an internal or external command, operable program or batch file.
what the heck:D windows... I'm not sure if it counts but I have Windows 11 LTSC installed Heroic however was working perfectly after installing for the 1st time
CommandMC
CommandMC5mo ago
Open up the environment variables dialog again. In the "User variables for Zed" section, highlight "Path" and press "Edit...". In the new window, press "Edit text...". Replace the value with the following: %USERPROFILE%\AppData\Local\Microsoft\WindowsApps; and press OK After that, repeat those steps for "Path" in the "System variables" section and replace it with %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%SYSTEMROOT%\System32\OpenSSH\ Note that this will make 3rd party programs that rely on being in PATH not work anymore, but given they also weren't working before making this change, that should be fine. We can add those paths in later once we confirm this works for PowerShell Once you've made both modifications, confirm all dialogs and reboot
sensitive-blue
sensitive-blueOP5mo ago
sorry for being smartass, but for system these seem to be there already, shall i still replace them?
No description
CommandMC
CommandMC5mo ago
Make sure to press "Edit text..." at the bottom. That'll disregard anything present in this list Basically PATH is a list of directories separated by semicolons. This dialog shows the list as a proper list, while "Edit text..." shows it as the true value What we're doing here is just returning your PATH variables to what's default on Windows
sensitive-blue
sensitive-blueOP5mo ago
alright, rebooted
CommandMC
CommandMC5mo ago
Right, now try opening command prompt & launching powershell in there again
sensitive-blue
sensitive-blueOP5mo ago
No description
sensitive-blue
sensitive-blueOP5mo ago
didn't launch it separately
CommandMC
CommandMC5mo ago
It won't do that if it's ran inside CMD But that's great, issue should be resolved now
sensitive-blue
sensitive-blueOP5mo ago
indeed it works, thank you very much! so installing apps messed up my path?
CommandMC
CommandMC5mo ago
I'm not sure what exactly caused it, but yeah, something modified that variable improperly
sensitive-blue
sensitive-blueOP5mo ago
Alright, so third party apps should still work? I tried one, and it does seem to
CommandMC
CommandMC5mo ago
Yeah what I meant was that you won't have some stuff on PATH anymore. (node, git, dotnet and python should be the important ones) If you don't use those apps from the commandline anyways, that's not a concern If you do need those apps on cmd, you can add the folders from here back into the variable (by just clicking "New" and punching in the respective path
sensitive-blue
sensitive-blueOP5mo ago
I might use python later, actually I think I used it for decky loader for windows now that I think of it, maybe that's what messed up things Thanks again!

Did you find this page helpful?