Temp folder is not writeable for some applications, resulting app crashes

5

I dont know why, but suddenly many applications in my computer can't start. For example Chrome Portable shows this error on execution:

NSIS Error

Error writing temporary file. Make sure your temp folder is valid

Many other applications just show a Windows error reporting on execution.

Fortunately I had created a Norton Ghost image from the C drive four months ago (when I had absolutely no problem), but after a successful Windows restore, the problem is still the same! Google Chrome is still showing the error above and the other programs still can't be executed.

I searched whole internet for the reason. Most say it's a problem with the %Temp% folder permissions. I took ownership of the folder, set Temp folder owner to "Administrator or the current user", full access for "Admin" and "current user" and "Users" profile, but still it's the same! I have also done these to C:\windows\Temp folder.

I even cant execute "Process Monitor" to monitor the problem!

I even changed both %Temp% and C:\windows\Temp folders paths to c:\Temp but the problem is the same.

It seems many programs can't write files in Temp folder, but I see "Firefox Portable" can do that!

Specs: Win 7 32bit Ultimate SP1


I installed a new fresh windows 7 yesterday, but the problem is still there! i found something interesting: If i move Chrome Portable directory to upper roots of F drive, the program will start normally!! it seemes that windows has problems with specific paths, for example most of the applications on F:\programs\Install on my computer cant access Temp and result in error. i checked Permissions on F and Install folder, everything is just like other drives. some said use ICACLS F:\ /setintegritylevel H but it does not change anything. for now, the only way to get ride of this problem is to downgrade to Win XP so no Permissions and other damn security stuff won't work. please help me out of this headache.

Alireza

Posted 2013-10-07T18:43:30.210

Reputation: 73

1If taking ownership of the folder does not solve the problem ( horrible idea this shouldn't be required unless your entire system's permission system is toast ) and even it was toast a restoration of a previous backup would resolve the problem. So it sounds like your backup wasn't what you think it was. – Ramhound – 2013-10-07T18:51:56.107

1i'm absolutly sure the image is for 4 months ago as its modification date is 4 months ago, desktop icons are less (because desktop icons grow by the time lol :D) and the anti virus database is dated 4 months ago. i'm really surprised too that image restoring didnt worked. i think file permission settings are stored in another place than the windows drive. but where?! – Alireza – 2013-10-07T19:49:26.243

Answers

2

If you run a program (that is you, as in your account, not the OS/System) then I expect it to write to your temp folder. By default that is %osdrive% (aka C:\) users\username\AppData\local\temp.

You can verify that with starting cmd.exe and typing echo %tmp%

This should be different from the OS temp files! Else a user could modify files in the OS temp files and compromise the system.

Hennes

Posted 2013-10-07T18:43:30.210

Reputation: 60 739

i didnt get what you said but i checked echo %tmp% in and it was pointing to c:\temp (as i changed default temp path, its poining to the currect path) – Alireza – 2013-10-07T19:52:18.820

Do you have rights to write to C:\temp. (Where 'you' is 'your user-account'). – Hennes – 2013-10-07T19:58:48.160

yes current user and Admin both have full access to C:\temp – Alireza – 2013-10-07T20:02:00.537

0

The following solved the issue for my portable Firefox installation. You should look up Icacls and Integrity Levels before running this blindly.

firefox_lowIntegrity.bat

icacls "D:\{PATH_TO}\FirefoxPortable\FirefoxPortable.exe" /setintegritylevel low
REM DOWNLOADS:
icacls "C:\Users\{USER}\Downloads" /setintegritylevel (OI)(CI)low /t /c

REM TEMP:
icacls "C:\Users\{USER}\AppData\Local\Temp" /setintegritylevel (OI)(CI)low /t /c

REM add data LOCAL:
REM icacls "C:\Users\YourWindowsUserAccount\AppData\Local\Mozilla" /setintegritylevel (OI)(CI)low /t /c

REM add data ROAMING:
REM icacls "C:\Users\YourWindowsUserAccount\AppData\Roaming\Mozilla" /setintegritylevel (OI)(CI)low /t /c

REM FLASH:
REM icacls "C:\Users\YourWindowsUserAccount\AppData\Roaming\Macromedia\Flash Player" /setintegritylevel (OI)(CI)low /t /c

REM PORTABLE:
icacls "D:\{PATH_TO}\FirefoxPortable\App\Firefox\firefox.exe" /setintegritylevel low
icacls "D:\{PATH_TO}\FirefoxPortable\App" /setintegritylevel (OI)(CI)low /t /c
icacls "D:\{PATH_TO}\FirefoxPortable\Data" /setintegritylevel (OI)(CI)low /t /c

1AabS2QqsQ

Posted 2013-10-07T18:43:30.210

Reputation: 1

0

Here's what happened to me and what I did.

I couldn't install anything.

  1. Made a new local admin user - logged on tried install - same temp file access error.

  2. installed windows updates and ran malware bytes to see if some sneaky process had taken control - no change.

  3. Made myself owner of %USERPROFILE%\appdata\local\temp (c:\users\yourname\appdata\local\temp) - no change

  4. I then tried deleting the accursed temp folder but 'no go' even in safe mode.


So I left it and created a new folder in the same location called tmp

Then I changed the install paths

(right click my computer / advanced system settings / advanced /environmental variables)

edited temp to %USERPROFILE%\appdata\local\tmp and (similarly) tmp to %USERPROFILE%\appdata\local\tmp

Installs started working again - it looks like temp folder was either corrupted or in control of some other process that wouldn't let it go....

Conor

user510132

Posted 2013-10-07T18:43:30.210

Reputation: 1

...For what it's worth, in my case, I suspect it was actually dropbox that caused me to loose access to the folder... – user510132 – 2015-10-16T09:45:06.747