Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

windows temp file

Posted on 2011-03-16
10
490 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
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.

789 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