Automatic Deletion of %TEMP% Folder & Over Disk Utilization

Issue: Automatic Deletion of %TEMP% Folder

Problem Faced:

While running a Selenium automation script via the command terminal, I encountered an issue where the script failed to execute. Upon investigation, I discovered that the issue was due to the absence of the %TEMP% folder.

To resolve this, I ran the terminal as an administrator, which allowed the script to execute successfully even though the Temp folder was missing. However, after two days, I noticed that my entire disk space was utilized unexpectedly.

Steps Taken to Resolve the Issue:

  1. Performed Disk Cleanup since I had only the C:\ drive.
  2. Ran a File System Error Check using the command: sfc /scannow
  3. Optimized and Defragmented the Drive.
  4. Performed a Disk Check using the command: chkdsk C: /f /r
  5. Removed Recent Windows Updates via the Control Panel.
  6. Changed the TEMP and TMP Folder Location in Environment Variables:
    • Manually created a Temp folder in C:\Temp.
    • Updated system environment variables to point to this new location.

Persistent Issue:

Despite following the above steps, the %TEMP% folder continued to disappear immediately after running the Selenium automation script. Although I could execute the script by running the terminal as an administrator, the disk utilization reached 100% within two days.

When manually searching through C:\, I couldn't find any suspicious files or folders consuming the disk space. The space was occupied but not visibly allocated to any specific files.

Resolution:

How I Fixed the Automatic Deletion of %TEMP% Folder

Upon further research, I came across a tool developed by Dell specifically for users with their products. After scanning my device with this tool, I discovered that the critical update "Intel Management Engine Components Installer" was missing.

I proceeded to install the update, and after restarting the system, the issue with the %TEMP% folder disappearing automatically was resolved.

How I Solved the Issue Related to Over Disk Utilization

While I was able to resolve the %TEMP% folder automatic deletion issue, the problem of disk overuse persisted. I attempted to manually check each folder to identify the cause of the high disk usage, but it was time-consuming and, despite my efforts, I couldn't pinpoint the exact folder consuming the space.

After further research, I discovered the "TreeSize Free" software, developed by Jam-Software.com. This tool allowed me to gain a clearer view of my disk usage. I found that the "System Temp" folder was consuming around 75GB of space over the course of just two days due to the Chrome automation.

The reason I couldn't see the content of this folder through traditional methods was that, with the %TEMP% folder missing and the script executed with administrator privileges, the temporary files were being directed to the SystemTemp folder instead. Unlike the %TEMP% folder, the SystemTemp folder didn't delete its content as expected, leading to significant disk space consumption.

Once I identified this, I deleted the files from the SystemTemp folder using the TreeSize Free application, which freed up the disk space.


Previous Post Next Post

Ads.

Ads..