Solved

windows temp file

Posted on 2011-03-16
10
489 Views
Last Modified: 2012-06-21
i have found that multiple application user the c:\user\[username]\appdata\temp\ directory
so on my network, this temps folder vary between 2 gig and 22 gig of temp file

there is a way to control it, or to delete it when the session of a user start ?
0
Comment
Question by:GCI_SUPPORT
  • 5
  • 4
10 Comments
 
LVL 5

Expert Comment

by:sweeps
ID: 35147351
Creating the Batch File to Clean Temporary Files
1.Open Notepad and type the following:

cd C:\Users\%username%\AppData\Local
rmdir /S /Q Temp

2.Save the file as cleantemp.bat

3.Now double click on the file to remove your temporary files and free up space on your computer
If this doesn’t work and gives an access error, try replacing %username% with you windows login username.

Automating the Process of Deleting Temporary Files
To automate this process, so you do not need to remember to run it, do the following:

1.Right click on the batch file and select create shortcut
2.Place the shortcut in your startup folder in the start menu
Now when you log in to Windows 7, your temporary files will be deleted.

0
 

Author Comment

by:GCI_SUPPORT
ID: 35147358
thanks
ill give a try
0
 

Author Comment

by:GCI_SUPPORT
ID: 35147365
by the way there is a way to do it in a login script ?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:GCI_SUPPORT
ID: 35147501
reinstall windows, i don't think is a good idea. with a park of pc
0
 
LVL 5

Expert Comment

by:sweeps
ID: 35147567
Create the script and place it on a commonly accessible network share. maybe you can set it to run with  group policy and select Computer Configuration --> Windows Settings --> Scripts --> Log-Off or Shutdown. Add a reference to the script
0
 
LVL 5

Expert Comment

by:sweeps
ID: 35147625
also please try this out on a test machine first to make sure you get the desired results.
0
 
LVL 5

Accepted Solution

by:
sweeps earned 500 total points
ID: 35147898
OK, if you save the bat file on a mapped drive, then add this code into your logon vbs

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "put your network path here" & Chr(34), 0
Set WshShell = Nothing

it will only delete files that are not in use but seems to get most out of the folder.

change the "put your network path here" with the relevant network path.  

you can test this by putting just this code into a vbs file on your computer and put the bat file out on the network and look at your temp folder so you get the idea of how much stuff is in it.  Then run the vbs file.  Then recheck your temp folder and see that most items are removed.

as always a test machine is a good idea for testing this.
0
 
LVL 5

Expert Comment

by:sweeps
ID: 35149392
Thank you!
0
 

Author Comment

by:GCI_SUPPORT
ID: 35149517
thanks sweep everything is working fine
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question