Solving PostgreSQL installation problems on Windows for laptops without WSH
I was trying to install Postgres on another Windows machine then I ran into this "cannot write inside the TEMP variable" error so i'm here to help someone else who might be stumped on this issue. Basically it's most likely because you have not don't have WSH(windows script host) enabled. To find out if it is enabled hit Win + R
then type in wscript.exe
. If you get an error saying "Windows Script Host access is disabled on this machine. Contact your administrator for details" then it is obviously not enabled so we have to enable it for current users. So to do that let's head over to registry editor. Hit Win + R
and type in Regedit
go down to HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
then Right-click anywhere in the right pane of the Registry Editor and select New => DWORD Value
and call it "Enabled". Then, double-click it and set the Value data
field to "1".Now there could be already a variable named "Enabled" so if there is just don't bother creating a new variable just instead set the value data
field to "1", restart the Postgres installer and it should work then you can set it back to "0".
If it does not work, that means it is disabled across the local machine. The steps are the same, except when you enter regedit you'll navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings
instead and just follow the same steps above.
Hope this helps someone.