Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

windows temp file

Posted on 2011-03-16
10
Medium Priority
?
496 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
9 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
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 basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.

824 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