Can i delete files in temp folder in win 7?

April 28, 2011 at 19:47:24
Specs: Windows 7, 2.8 Hz/2GB
Can i delete all files in temp folder in win 7? How?

See More: Can i delete files in temp folder in win 7?

Report •

#1
April 28, 2011 at 19:55:56
Can i delete files in temp folder in win 7?
Can it cause problem after deleting it?
Hav thr any shortcut to delete temp files?
I hav cleaned C drive,but it doesnt clean all temp files



Report •

#2
April 28, 2011 at 23:07:50
You can delete .tmp files safely.

Here is a script which will do what you want. Copy and paste it to Notepad and save it as Clean_temp.vbs You can also use CCleaner obtainable here http://www.google.com.au/search?q=c... which will also clean temp files but use it with care.


'---------------------------------------------------------
'Written by Vic Laurie, January, 2006
'Revised October, 2007
'All rights reserved. Provided as is
'with no guarantees, express or implied
'User assumes all responsibility
'---------------------------------------------------------


'--------------------------------------
'Description- This script deletes files and subfolders
'from the temporary folders %TEMP% and %WINDIR%\temp
'--------------------------------------

Option explicit
Dim msgIntro, objWshell, i, sStatement
Dim arrCmd(3)

Set objWshell = Wscript.CreateObject("Wscript.Shell")
msgIntro = msgBox("This program will clean the Temp files." & vbCrlf & "Files that are currently in use will not be deleted." & vbCrlf & "Do you want to proceed?", vbYesNo+vbQuestion)
If msgIntro = vbNo then Wscript.Quit

arrCmd(0) = "cmd /c rd /s /q %temp%"
arrCmd(1)= "cmd /c if not exist %temp%\nul md %temp%"
arrCmd(2) = "cmd /c rd /s /q %windir%\temp"
arrCmd(3) = "cmd /c if not exist %windir%\temp\nul md %windir%\temp"
For i = 0 to 3
sStatement = arrCmd(i)
objWshell.Run sStatement,7,true
next
Set objWshell = Nothing
msgBox "Done"
Wscript.Quit


Report •

#3
April 29, 2011 at 05:27:41
Saving that one myself. Thanks.

You have to be a little bit crazy to keep you from going insane.


Report •

Related Solutions

#4
April 29, 2011 at 17:58:12
Glad you can use it!

Regards.


Report •

Ask Question