A Windows 98 & ME forum. Win98banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Win98banter forum » Windows 98 » Improving Performance
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

Windows Temp file



 
 
Thread Tools Display Modes
  #1  
Old July 1st 04, 12:41 PM
Czarnee
external usenet poster
 
Posts: n/a
Default Windows Temp file

I keep my Windows 98 pretty clean of clutter. I do disc
clean up and have the temp file checked and clear it each
time. However in Windows Explorer under "Windows" there
is a "Temp" folder. This has a lot of files and I need to
know if it is okay to clean this too.
  #2  
Old July 1st 04, 02:25 PM
Buffalo
external usenet poster
 
Posts: n/a
Default Windows Temp file

Usually right after a fresh reboot is the best time to delete the contents
of the Windows\temp folder.
This is just because something in there may be needed to complete a program,
you just installed, that requires a reboot.
This is why it is a bad idea to have a batch file which automatically
deletes the Windows\temp file on every bootup.
You may find a file in there from ZoneAlarm(or others) that won't delete
because it is in use.
Unless you save downloads and/or store certain files in that folder on
purpose, it is safe to delete the contents.
I do it every day.

"Czarnee" wrote in message
...
I keep my Windows 98 pretty clean of clutter. I do disc
clean up and have the temp file checked and clear it each
time. However in Windows Explorer under "Windows" there
is a "Temp" folder. This has a lot of files and I need to
know if it is okay to clean this too.



  #3  
Old July 1st 04, 03:29 PM
Eric P.
external usenet poster
 
Posts: n/a
Default Windows Temp file

I use below VBS program from the StartUp folder on my five computers,
it's executed last during startup of Windows and doesn't do any damage.


'DeleteTempFiles.vbs - A utility to clean Win9x temp directory
'at boot. Put a shortcut to this file in Startup directory.
'© Bill James - - rev 04 Jan 2000
'
'Original author - Michael Harris - posted to
'microsoft.public.scripting.vbs newsgroup on 28 Aug 1999.
'
'Modifications by Bill James: Added safety check for dangerous
'temp folder settting. Revised summary popup to include
'savings for this run and cumulative savings to date.
'Disabled the popup!!!

Option Explicit

Dim fso,ws,Title
Set fso = CreateObject("Scripting.FileSystemObject")
Set ws = WScript.CreateObject("WScript.Shell")
Title = "Temp File Cleaner"

Dim TmpDir
TmpDir = ws.Environment("Process")("Temp")

ChkTmpSafe

Dim OldTmpSize
OldTmpSize = fso.GetFolder(TmpDir).size

Dim arFiles(),cnt,dcnt,Fldr,SubFldr,File
cnt = -1
dcnt = 0
DelTmpFiles TmpDir

DelEmptyFldrs TmpDir

Dim strF,strD,RptSize,TotSave

' Disabled by Eric, popup is very annoying!
'CalcSave
'If dcnt = 1 Then ws.Popup cnt & strF & dcnt & _
' strD & vbCRLF & vbCRLF & RptSize & vbCRLF & _
' vbCRLF & TotSave,60,Title

Cleanup

Sub ChkTmpSafe
Dim Drv,Unsafe,WinDir,ComDir,PgmDir,SysDir,UnsafeDir
If TmpDir = "" Then
ws.Popup "Unsafe condition detected. %TEMP% " &_
"Variable is not set.",60,Title,16
Cleanup
WScript.Quit
End If
If Not fso.FolderExists(TmpDir) Then
fso.CreateFolder(TmpDir)
Cleanup
WScript.Quit
End If
For Each Drv In(fso.Drives)
If Drv.DriveType = 2 or Drv.DriveType = 3 Then _
UnSafe = UnSafe & Drv.RootFolder & "|"
Next
Unsafe = Unsafe & fso.GetSpecialFolder(0) & "|"
Unsafe = Unsafe & fso.GetSpecialFolder(0) & "\Command|"
Unsafe = Unsafe & ws.RegRead("HKLM\Software\Microsoft" _
& "\Windows\CurrentVersion\ProgramFilesPath") & "|"
Unsafe = Unsafe & fso.getspecialfolder(1)
Unsafe = Split(Unsafe,"|",-1,1)
For Each UnsafeDir In Unsafe
If UCase(UnsafeDir) = UCase(TmpDir) Or _
UCase(UnsafeDir) & "\" = UCase(TmpDir) Or _
UCase(UnsafeDir) = UCase(TmpDir) & "\" Then
ws.Popup "Unsafe condition detected. %TEMP% " &_
"Variable is set to " & TmpDir,60,Title,16
Cleanup
WScript.Quit
End If
Next
End Sub

Sub DelTmpFiles(FldrSpec)
Set Fldr = fso.GetFolder(FldrSpec)
For Each File In Fldr.Files
cnt = cnt + 1
Redim Preserve arFiles(cnt)
Set arFiles(cnt) = File
Next
For Each SubFldr in Fldr.SubFolders
DelTmpFiles SubFldr
Next
For Each file in arFiles
On Error Resume Next
file.Delete True
If Err.Number = 0 Then dcnt = dcnt + 1
Err.Clear
Next
End Sub

Sub DelEmptyFldrs(FldrSpec)
Set Fldr = fso.GetFolder(FldrSpec)
For Each SubFldr in Fldr.SubFolders
DelEmptyFldrs SubFldr
Next
On Error Resume Next
If UCase(Fldr.Path) UCase(TmpDir) Then
If Fldr.Files.Count = 0 Then
If Fldr.SubFolders.Count = 0 Then
Fldr.Delete
End If
End If
End If
If Err.Number = 76 Then
Err.Clear
On Error GoTo 0
DelEmptyFldrs(TmpDir)
End If
End Sub

Sub CalcSave
Dim NewTmpSize,SaveSize,s1,s2
Dim TmpClnLog,OldSave,HideLog,Log
NewTmpSize = fso.GetFolder(TmpDir).size
SaveSize = OldTmpSize - NewTmpSize
s1 = " free space reclaimed."
If SaveSize 1024 Then
RptSize = SaveSize & " bytes" & s1
ElseIf SaveSize 1048576 Then
RptSize = Round(SaveSize / 1024) & " KB" & s1
Else RptSize = Round(SaveSize / 1048576) & " MB" & s1
End If
Log = fso.GetSpecialFolder(0) & "\TempClean.Log"
If Not fso.FileExists(Log) Then fso.CreateTextFile(Log)
If fso.GetFile(Log).Size = 0 Then
Set TmpClnLog = fso.OpenTextFile(Log,8,True)
TmpClnLog.WriteBlankLines(1)
End If
Set TmpClnLog = fso.OpenTextFile(Log,1)
OldSave = TmpClnLog.ReadLine
If Not IsNumeric(OldSave) Then OldSave = 0
TotSave = OldSave + SaveSize
Set TmpClnLog = fso.OpenTextFile(Log,2)
TmpClnLog.WriteLine TotSave
TmpClnLog.Close
s2 = " reclaimed to date."
If TotSave 1024 Then
TotSave = TotSave & " bytes" & s2
ElseIf TotSave 1048576 Then
TotSave = Round(TotSave / 1024) & " KB" & s2
Else TotSave = Round(TotSave / 1048576) & " MB" & s2
End If
cnt = cnt + 1
If cnt = 1 Then strF = " file found, " _
Else strF = " files found, "
If dcnt = 1 Then strD = " file deleted." _
Else strD = " files deleted."
Set TmpClnLog = Nothing
End Sub

Sub Cleanup
Set fso = Nothing
Set ws = Nothing
Set Fldr = Nothing
End Sub


Buffalo wrote:
Usually right after a fresh reboot is the best time to delete the contents
of the Windows\temp folder.
This is just because something in there may be needed to complete a program,
you just installed, that requires a reboot.
This is why it is a bad idea to have a batch file which automatically
deletes the Windows\temp file on every bootup.
You may find a file in there from ZoneAlarm(or others) that won't delete
because it is in use.
Unless you save downloads and/or store certain files in that folder on
purpose, it is safe to delete the contents.
I do it every day.

"Czarnee" wrote in message
...

I keep my Windows 98 pretty clean of clutter. I do disc
clean up and have the temp file checked and clear it each
time. However in Windows Explorer under "Windows" there
is a "Temp" folder. This has a lot of files and I need to
know if it is okay to clean this too.





  #4  
Old July 1st 04, 05:39 PM
Buffalo
external usenet poster
 
Posts: n/a
Default Windows Temp file

Thanks for posting it.

"Eric P." wrote in message
...
I use below VBS program from the StartUp folder on my five computers,
it's executed last during startup of Windows and doesn't do any damage.


'DeleteTempFiles.vbs - A utility to clean Win9x temp directory
'at boot. Put a shortcut to this file in Startup directory.
'© Bill James - - rev 04 Jan 2000
'
'Original author - Michael Harris - posted to
'microsoft.public.scripting.vbs newsgroup on 28 Aug 1999.
'
'Modifications by Bill James: Added safety check for dangerous
'temp folder settting. Revised summary popup to include
'savings for this run and cumulative savings to date.
'Disabled the popup!!!

Option Explicit

Dim fso,ws,Title
Set fso = CreateObject("Scripting.FileSystemObject")
Set ws = WScript.CreateObject("WScript.Shell")
Title = "Temp File Cleaner"

Dim TmpDir
TmpDir = ws.Environment("Process")("Temp")

ChkTmpSafe

Dim OldTmpSize
OldTmpSize = fso.GetFolder(TmpDir).size

Dim arFiles(),cnt,dcnt,Fldr,SubFldr,File
cnt = -1
dcnt = 0
DelTmpFiles TmpDir

DelEmptyFldrs TmpDir

Dim strF,strD,RptSize,TotSave

' Disabled by Eric, popup is very annoying!
'CalcSave
'If dcnt = 1 Then ws.Popup cnt & strF & dcnt & _
' strD & vbCRLF & vbCRLF & RptSize & vbCRLF & _
' vbCRLF & TotSave,60,Title

Cleanup

Sub ChkTmpSafe
Dim Drv,Unsafe,WinDir,ComDir,PgmDir,SysDir,UnsafeDir
If TmpDir = "" Then
ws.Popup "Unsafe condition detected. %TEMP% " &_
"Variable is not set.",60,Title,16
Cleanup
WScript.Quit
End If
If Not fso.FolderExists(TmpDir) Then
fso.CreateFolder(TmpDir)
Cleanup
WScript.Quit
End If
For Each Drv In(fso.Drives)
If Drv.DriveType = 2 or Drv.DriveType = 3 Then _
UnSafe = UnSafe & Drv.RootFolder & "|"
Next
Unsafe = Unsafe & fso.GetSpecialFolder(0) & "|"
Unsafe = Unsafe & fso.GetSpecialFolder(0) & "\Command|"
Unsafe = Unsafe & ws.RegRead("HKLM\Software\Microsoft" _
& "\Windows\CurrentVersion\ProgramFilesPath") & "|"
Unsafe = Unsafe & fso.getspecialfolder(1)
Unsafe = Split(Unsafe,"|",-1,1)
For Each UnsafeDir In Unsafe
If UCase(UnsafeDir) = UCase(TmpDir) Or _
UCase(UnsafeDir) & "\" = UCase(TmpDir) Or _
UCase(UnsafeDir) = UCase(TmpDir) & "\" Then
ws.Popup "Unsafe condition detected. %TEMP% " &_
"Variable is set to " & TmpDir,60,Title,16
Cleanup
WScript.Quit
End If
Next
End Sub

Sub DelTmpFiles(FldrSpec)
Set Fldr = fso.GetFolder(FldrSpec)
For Each File In Fldr.Files
cnt = cnt + 1
Redim Preserve arFiles(cnt)
Set arFiles(cnt) = File
Next
For Each SubFldr in Fldr.SubFolders
DelTmpFiles SubFldr
Next
For Each file in arFiles
On Error Resume Next
file.Delete True
If Err.Number = 0 Then dcnt = dcnt + 1
Err.Clear
Next
End Sub

Sub DelEmptyFldrs(FldrSpec)
Set Fldr = fso.GetFolder(FldrSpec)
For Each SubFldr in Fldr.SubFolders
DelEmptyFldrs SubFldr
Next
On Error Resume Next
If UCase(Fldr.Path) UCase(TmpDir) Then
If Fldr.Files.Count = 0 Then
If Fldr.SubFolders.Count = 0 Then
Fldr.Delete
End If
End If
End If
If Err.Number = 76 Then
Err.Clear
On Error GoTo 0
DelEmptyFldrs(TmpDir)
End If
End Sub

Sub CalcSave
Dim NewTmpSize,SaveSize,s1,s2
Dim TmpClnLog,OldSave,HideLog,Log
NewTmpSize = fso.GetFolder(TmpDir).size
SaveSize = OldTmpSize - NewTmpSize
s1 = " free space reclaimed."
If SaveSize 1024 Then
RptSize = SaveSize & " bytes" & s1
ElseIf SaveSize 1048576 Then
RptSize = Round(SaveSize / 1024) & " KB" & s1
Else RptSize = Round(SaveSize / 1048576) & " MB" & s1
End If
Log = fso.GetSpecialFolder(0) & "\TempClean.Log"
If Not fso.FileExists(Log) Then fso.CreateTextFile(Log)
If fso.GetFile(Log).Size = 0 Then
Set TmpClnLog = fso.OpenTextFile(Log,8,True)
TmpClnLog.WriteBlankLines(1)
End If
Set TmpClnLog = fso.OpenTextFile(Log,1)
OldSave = TmpClnLog.ReadLine
If Not IsNumeric(OldSave) Then OldSave = 0
TotSave = OldSave + SaveSize
Set TmpClnLog = fso.OpenTextFile(Log,2)
TmpClnLog.WriteLine TotSave
TmpClnLog.Close
s2 = " reclaimed to date."
If TotSave 1024 Then
TotSave = TotSave & " bytes" & s2
ElseIf TotSave 1048576 Then
TotSave = Round(TotSave / 1024) & " KB" & s2
Else TotSave = Round(TotSave / 1048576) & " MB" & s2
End If
cnt = cnt + 1
If cnt = 1 Then strF = " file found, " _
Else strF = " files found, "
If dcnt = 1 Then strD = " file deleted." _
Else strD = " files deleted."
Set TmpClnLog = Nothing
End Sub

Sub Cleanup
Set fso = Nothing
Set ws = Nothing
Set Fldr = Nothing
End Sub


Buffalo wrote:
Usually right after a fresh reboot is the best time to delete the

contents
of the Windows\temp folder.
This is just because something in there may be needed to complete a

program,
you just installed, that requires a reboot.
This is why it is a bad idea to have a batch file which automatically
deletes the Windows\temp file on every bootup.
You may find a file in there from ZoneAlarm(or others) that won't delete
because it is in use.
Unless you save downloads and/or store certain files in that folder on
purpose, it is safe to delete the contents.
I do it every day.

"Czarnee" wrote in message
...

I keep my Windows 98 pretty clean of clutter. I do disc
clean up and have the temp file checked and clear it each
time. However in Windows Explorer under "Windows" there
is a "Temp" folder. This has a lot of files and I need to
know if it is okay to clean this too.







  #5  
Old July 1st 04, 06:04 PM
Lil' Dave
external usenet poster
 
Posts: n/a
Default Windows Temp file

Think you had the right idea to begin with. If it won't delete, its in use.
If it does, don't worry about it. With exception of intial app installs of
course.
"Buffalo" wrote in message
news:e7XEc.8238$MB3.4948@attbi_s04...
Thanks for posting it.

"Eric P." wrote in message
...
I use below VBS program from the StartUp folder on my five computers,
it's executed last during startup of Windows and doesn't do any damage.


'DeleteTempFiles.vbs - A utility to clean Win9x temp directory
'at boot. Put a shortcut to this file in Startup directory.
'© Bill James - - rev 04 Jan 2000
'
'Original author - Michael Harris - posted to
'microsoft.public.scripting.vbs newsgroup on 28 Aug 1999.
'
'Modifications by Bill James: Added safety check for dangerous
'temp folder settting. Revised summary popup to include
'savings for this run and cumulative savings to date.
'Disabled the popup!!!

Option Explicit

Dim fso,ws,Title
Set fso = CreateObject("Scripting.FileSystemObject")
Set ws = WScript.CreateObject("WScript.Shell")
Title = "Temp File Cleaner"

Dim TmpDir
TmpDir = ws.Environment("Process")("Temp")

ChkTmpSafe

Dim OldTmpSize
OldTmpSize = fso.GetFolder(TmpDir).size

Dim arFiles(),cnt,dcnt,Fldr,SubFldr,File
cnt = -1
dcnt = 0
DelTmpFiles TmpDir

DelEmptyFldrs TmpDir

Dim strF,strD,RptSize,TotSave

' Disabled by Eric, popup is very annoying!
'CalcSave
'If dcnt = 1 Then ws.Popup cnt & strF & dcnt & _
' strD & vbCRLF & vbCRLF & RptSize & vbCRLF & _
' vbCRLF & TotSave,60,Title

Cleanup

Sub ChkTmpSafe
Dim Drv,Unsafe,WinDir,ComDir,PgmDir,SysDir,UnsafeDir
If TmpDir = "" Then
ws.Popup "Unsafe condition detected. %TEMP% " &_
"Variable is not set.",60,Title,16
Cleanup
WScript.Quit
End If
If Not fso.FolderExists(TmpDir) Then
fso.CreateFolder(TmpDir)
Cleanup
WScript.Quit
End If
For Each Drv In(fso.Drives)
If Drv.DriveType = 2 or Drv.DriveType = 3 Then _
UnSafe = UnSafe & Drv.RootFolder & "|"
Next
Unsafe = Unsafe & fso.GetSpecialFolder(0) & "|"
Unsafe = Unsafe & fso.GetSpecialFolder(0) & "\Command|"
Unsafe = Unsafe & ws.RegRead("HKLM\Software\Microsoft" _
& "\Windows\CurrentVersion\ProgramFilesPath") & "|"
Unsafe = Unsafe & fso.getspecialfolder(1)
Unsafe = Split(Unsafe,"|",-1,1)
For Each UnsafeDir In Unsafe
If UCase(UnsafeDir) = UCase(TmpDir) Or _
UCase(UnsafeDir) & "\" = UCase(TmpDir) Or _
UCase(UnsafeDir) = UCase(TmpDir) & "\" Then
ws.Popup "Unsafe condition detected. %TEMP% " &_
"Variable is set to " & TmpDir,60,Title,16
Cleanup
WScript.Quit
End If
Next
End Sub

Sub DelTmpFiles(FldrSpec)
Set Fldr = fso.GetFolder(FldrSpec)
For Each File In Fldr.Files
cnt = cnt + 1
Redim Preserve arFiles(cnt)
Set arFiles(cnt) = File
Next
For Each SubFldr in Fldr.SubFolders
DelTmpFiles SubFldr
Next
For Each file in arFiles
On Error Resume Next
file.Delete True
If Err.Number = 0 Then dcnt = dcnt + 1
Err.Clear
Next
End Sub

Sub DelEmptyFldrs(FldrSpec)
Set Fldr = fso.GetFolder(FldrSpec)
For Each SubFldr in Fldr.SubFolders
DelEmptyFldrs SubFldr
Next
On Error Resume Next
If UCase(Fldr.Path) UCase(TmpDir) Then
If Fldr.Files.Count = 0 Then
If Fldr.SubFolders.Count = 0 Then
Fldr.Delete
End If
End If
End If
If Err.Number = 76 Then
Err.Clear
On Error GoTo 0
DelEmptyFldrs(TmpDir)
End If
End Sub

Sub CalcSave
Dim NewTmpSize,SaveSize,s1,s2
Dim TmpClnLog,OldSave,HideLog,Log
NewTmpSize = fso.GetFolder(TmpDir).size
SaveSize = OldTmpSize - NewTmpSize
s1 = " free space reclaimed."
If SaveSize 1024 Then
RptSize = SaveSize & " bytes" & s1
ElseIf SaveSize 1048576 Then
RptSize = Round(SaveSize / 1024) & " KB" & s1
Else RptSize = Round(SaveSize / 1048576) & " MB" & s1
End If
Log = fso.GetSpecialFolder(0) & "\TempClean.Log"
If Not fso.FileExists(Log) Then fso.CreateTextFile(Log)
If fso.GetFile(Log).Size = 0 Then
Set TmpClnLog = fso.OpenTextFile(Log,8,True)
TmpClnLog.WriteBlankLines(1)
End If
Set TmpClnLog = fso.OpenTextFile(Log,1)
OldSave = TmpClnLog.ReadLine
If Not IsNumeric(OldSave) Then OldSave = 0
TotSave = OldSave + SaveSize
Set TmpClnLog = fso.OpenTextFile(Log,2)
TmpClnLog.WriteLine TotSave
TmpClnLog.Close
s2 = " reclaimed to date."
If TotSave 1024 Then
TotSave = TotSave & " bytes" & s2
ElseIf TotSave 1048576 Then
TotSave = Round(TotSave / 1024) & " KB" & s2
Else TotSave = Round(TotSave / 1048576) & " MB" & s2
End If
cnt = cnt + 1
If cnt = 1 Then strF = " file found, " _
Else strF = " files found, "
If dcnt = 1 Then strD = " file deleted." _
Else strD = " files deleted."
Set TmpClnLog = Nothing
End Sub

Sub Cleanup
Set fso = Nothing
Set ws = Nothing
Set Fldr = Nothing
End Sub


Buffalo wrote:
Usually right after a fresh reboot is the best time to delete the

contents
of the Windows\temp folder.
This is just because something in there may be needed to complete a

program,
you just installed, that requires a reboot.
This is why it is a bad idea to have a batch file which automatically
deletes the Windows\temp file on every bootup.
You may find a file in there from ZoneAlarm(or others) that won't

delete
because it is in use.
Unless you save downloads and/or store certain files in that folder on
purpose, it is safe to delete the contents.
I do it every day.

"Czarnee" wrote in message
...

I keep my Windows 98 pretty clean of clutter. I do disc
clean up and have the temp file checked and clear it each
time. However in Windows Explorer under "Windows" there
is a "Temp" folder. This has a lot of files and I need to
know if it is okay to clean this too.








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Security Bulletin MS04-024 - Vulnerability in Windows Shell Could Allow Remote Code Execution (839645) Gary S. Terhune General 2 July 14th 04 05:06 AM
Please help! Display settings !! Mitzi Monitors & Displays 12 July 11th 04 05:19 AM
Major Problem Matty General 3 July 4th 04 05:02 PM
Windows can't create a Temp file in Windows? Canapril General 3 June 29th 04 12:16 AM
Win98SE - problem with USB printer HBYardSale Software & Applications 2 June 20th 04 06:27 PM


All times are GMT +1. The time now is 02:05 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Win98banter.
The comments are property of their posters.