Sunday, March 18, 2012

Unable to write inside TEMP environment variable path

I stumbled upon this beautiful error when trying to re-install my PostgreSQL 9.1.3 server: Unable to write inside TEMP environment variable path.

After some research and trial-and-terror [sic], I came to the conclusion that the essence of the problem had been a tiny change I made to my system's file associations (via Notepad++).

Here's how I solved it and how you can do it too:



I first made some research in the existing community but the solutions I found did not apply to me (I provide some links at the end of the page to these solutions):
  • I checked if it was related to the option "Use temporary folders per session" in the "Remote Desktop Session Host Configuration";
  • I checked the status of "Windows Script Host Settings" (whost.exe);
  • I completely skipped antivirus-related stuff as I don't have any antivirus.

So, to understand why this error was happening, I went to my TEMP folder and read the log from the PostgreSQL installer:

C:\Users\myuser\AppData\Local\Temp\bitrock_installer.log

Which mentioned an interesting detail:
  • Input Error: There is no script engine for file extension ".vbs".
So, I picked up another file from the TEMP folder, the actual script used by the installer:

C:\Users\myuser\AppData\Local\Temp\prerun_checks.vbs

And tried to run it through the console using cscript:

Input Error: There is no script engine for file extension ".vbs".

The same!
I researched a bit more and discovered that the type of file associated with the vbs extension had been changed. In my case, by Notepad++. After I installed Notepad++, I associated some file extensions with it (including vbs), thus causing problems when detecting the type of the script (which shouldn't happen).


Fixing it


Run the almighty regedit, navigate to HKEY_CLASSES_ROOT\.vbs and change the (Default) key back to the string VBSFile. In my case it had been previously altered to Notepad++_file.

How the registry entries looked like before


How the registry entries look when fixed

Then, restart PostgreSQL's installer and everything should go fine.


This is just a possible pair of cause-solution. Other solutions can be reached via some of the links below, don't forget to check them if my post doesn't apply to your issue.


Useful links:
Input Error: There is no script engine for file extension “.vbs”.
Running VBScript and JScript files from the Command Shell
Temporary directory environment variable in Windows Server 2008
Running & Installing PostgreSQL On Native Windows
Collect the installer log file (PostgreSQL)
Unable to write inside TEMP environment path

15 comments:

  1. Thanks for this! I was hitting this problem, and thought it was my McAfee install. But because corporate policy prevents me from disabling McAfee, I thought I was going to be stuck, until I found your post.

    ReplyDelete
  2. Just wanted to drop a thanks.

    ReplyDelete
  3. Dude, you ROCK!!! For MONTHS i have been looking for a solution to this FREAKIN' PROBLEM!!!! UGGGHH!!! Thanks to GOD I was bored enough to try searching once more and BAM!!! Your page popped up! Some people mentioned this but not as clear as you did and I was able to follow your advice and BAM!!! SOLVED!!!! God Bless, have a GREAT YEAR!!

    ReplyDelete
  4. Thank you very very much!

    ReplyDelete
  5. Thank U Very Much, Very Help Us

    ReplyDelete
  6. Thank you so much! You saved my ass:)

    ReplyDelete
  7. Thanks dude.. This is wht is called striking the core of the problem

    ReplyDelete
  8. Some great thoughts, and I'll certainly take it onboard with my writing. I can't help but think you should take a look at a film called 'Freedom Deep' when talking about 'Book of Eli'. The Denzel film shares a staggering amount of similarities to this independent Australian film, particularly the main characters and themes. Hell, even a lot of the shots and scenes are familiar! Keep up the good work, this blog is worth its weight in gold!
    buy-college-essay
    online-writing-services
    Accounts Software For Small Business

    ReplyDelete
  9. Thanks a lot. In my case, it has value as "vbs_suto_file"

    ReplyDelete

Feel free to share your thoughts!