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-blueOP•5mo ago
deep-jade•5mo 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-blueOP•5mo ago
I have Heroic 2.15.2 HOTFIX #2 installed, then I guess I wait for the patch to go through.
Thank you!
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-blueOP•5mo ago
if I type
powershell
, it displays this message, however PowerShell is present on my system, I just launched it with its icon.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 screenshotsensitive-blueOP•5mo ago
Hm, that looks normal enough
What does
dir C:\Windows\System32\WindowsPowerShell\v1.0\
say?sensitive-blueOP•5mo ago

Yup that's in there
How odd
sensitive-blueOP•5mo ago
sorry, one line got left out of the screenshot: Volume in drive C has no label.
I don't know if that matters
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-blueOP•5mo ago
no actually

sensitive-blueOP•5mo ago
but I have powershell installed:

Right, it won't spawn a new window, it'll just create the prompt in the existing one
sensitive-blueOP•5mo ago
and the weird thing is, Heroic had been installed and was working fine
no, it won't launch powershell like this
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-blueOP•5mo ago
alright!
I don't expect this to be an issue, but what does
echo %PATHEXT%
say?sensitive-blueOP•5mo ago
shall I relauch CMD prompt?
You'll have to exit the nested PowerShell by running
exit
once first
(alternatively just re-launch CMD, yes)sensitive-blueOP•5mo 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-blueOP•5mo ago
it's the latter
INFO: Could not find files for the given pattern(s).
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-blueOP•5mo ago

sensitive-blueOP•5mo ago
it didn't launch
just as PS within CMD
Yeah sorry, that's what I meant
sensitive-blueOP•5mo ago
ah, ok
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-blueOP•5mo ago
gotcha, let me know what you need from me
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-blueOP•5mo ago
hmm when I enter
echo %PATH%
, this comes up: C:\Windows\System32\WindowsPowerShell\v1.0\(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-blueOP•5mo 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-blueOP•5mo ago
can the hightlighted line be a problem with the slash at the end?

That's fine, other paths in there also have a trailing slash
This might seem a little bone-headed, but could you try
Just to confirm that doesn't work
sensitive-blueOP•5mo ago
what should I look for?
PowerShell shouldn't start after that (the variable contents there are the same that are currently set)
automatic-azure•5mo 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 latelysensitive-blueOP•5mo ago

PowerShell's not found. If the error would be anything after it, it'd look different
automatic-azure•5mo ago
like, does this file exists?
C:\Users\Zed\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\x64\win32\gogdl.exe
Huh, that's interesting
Could you try removing the first entry here (& rebooting after that)?
sensitive-blueOP•5mo 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?
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-blueOP•5mo ago
yes

sensitive-blueOP•5mo ago
Removed it and rebooted
launched Heroic, same error
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-blueOP•5mo 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
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-blueOP•5mo ago
okay, let me send a screenshot
Alright, so there's a larger issue here
That's, uh... bad? But also good, since we now know where to look
sensitive-blueOP•5mo 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
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 rebootsensitive-blueOP•5mo ago
sorry for being smartass, but for system these seem to be there already, shall i still replace them?

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-blueOP•5mo ago
alright, rebooted
Right, now try opening command prompt & launching
powershell
in there againsensitive-blueOP•5mo ago

sensitive-blueOP•5mo ago
didn't launch it separately
It won't do that if it's ran inside CMD
But that's great, issue should be resolved now
sensitive-blueOP•5mo ago
indeed it works, thank you very much! so installing apps messed up my path?
I'm not sure what exactly caused it, but yeah, something modified that variable improperly
sensitive-blueOP•5mo ago
Alright, so third party apps should still work? I tried one, and it does seem to
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 pathsensitive-blueOP•5mo 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!