thread329-405235
LogOff Script to delete temp files.
VBscript
,,,Following script will verify the folder path then delete the files in the path.
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
C:\DOCUMENTS AND SETTINGS\USERNAME\COOKIES\*.*
C:\DOCUMENTS AND SETTINGS\USERNAME\RECENT\*.*
C:\DOCUMENTS AND SETTINGS\USERNAME\COOKIES\*.*
C:\DOCUMENTS AND SETTINGS\USERNAME\LOCAL SETTINGS\TEMP\*.*
C:\DOCUMENTS AND SETTINGS\USERNAME\LOCAL SETTINGS\TEMPORARY INTERNET FILE\*.*
C:\WIndows\TEMP\*.*
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
The user may not have rights to delete from C:\Windows\Temp
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set wshNetwork = Wscript.CreateObject("Wscript.Network")
struser = wshNetwork.UserName
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists("C:\DOCUMENTS AND SETTINGS\" & struser & "\RECENT") Then
objfso.DeleteFile "C:\DOCUMENTS AND SETTINGS\" & struser & "\RECENT\*.*", Force
Else
Wscript.Echo "Folder does not exist."
End If
If objFSO.FolderExists("C:\DOCUMENTS AND SETTINGS\" & struser & "\LOCAL SETTINGS\TEMP") Then
objfso.DeleteFile "C:\DOCUMENTS AND SETTINGS\" & struser & "\LOCAL SETTINGS\TEMP\*.*",Force
Else
Wscript.Echo "Folder does not exist."
End If
If objFSO.FolderExists("C:\DOCUMENTS AND SETTINGS\" & struser & "\LOCAL SETTINGS\TEMPORARY INTERNET FILES") Then
objfso.DeleteFile "C:\DOCUMENTS AND SETTINGS\" & struser & "\LOCAL SETTINGS\TEMPORARY INTERNET FILES\*.*",Force
Else
Wscript.Echo "Folder does not exist."
End If
If objFSO.FolderExists("C:\Documents and Settings\" & struser & "\Application Data\ICAClient\Cache") Then
objfso.DeleteFile "C:\Documents and Settings\" & struser & "\Application Data\ICAClient\Cache\*.*",Force
Else
Wscript.Echo "Folder does not exist."
End If
If objFSO.FolderExists("C:\Documents and Settings\" & struser & "\Application Data\Juniper Networks\EPCheck") Then
objfso.DeleteFile "C:\Documents and Settings\" & struser & "\Application Data\Juniper Networks\EPCheck\*.*",Force
End If
set wshNetwork = Nothing
set objFSO = Nothing
LogOff Script to delete temp files.
VBscript
,,,Following script will verify the folder path then delete the files in the path.
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
C:\DOCUMENTS AND SETTINGS\USERNAME\COOKIES\*.*
C:\DOCUMENTS AND SETTINGS\USERNAME\RECENT\*.*
C:\DOCUMENTS AND SETTINGS\USERNAME\COOKIES\*.*
C:\DOCUMENTS AND SETTINGS\USERNAME\LOCAL SETTINGS\TEMP\*.*
C:\DOCUMENTS AND SETTINGS\USERNAME\LOCAL SETTINGS\TEMPORARY INTERNET FILE\*.*
C:\WIndows\TEMP\*.*
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
The user may not have rights to delete from C:\Windows\Temp
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set wshNetwork = Wscript.CreateObject("Wscript.Network")
struser = wshNetwork.UserName
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists("C:\DOCUMENTS AND SETTINGS\" & struser & "\RECENT") Then
objfso.DeleteFile "C:\DOCUMENTS AND SETTINGS\" & struser & "\RECENT\*.*", Force
Else
Wscript.Echo "Folder does not exist."
End If
If objFSO.FolderExists("C:\DOCUMENTS AND SETTINGS\" & struser & "\LOCAL SETTINGS\TEMP") Then
objfso.DeleteFile "C:\DOCUMENTS AND SETTINGS\" & struser & "\LOCAL SETTINGS\TEMP\*.*",Force
Else
Wscript.Echo "Folder does not exist."
End If
If objFSO.FolderExists("C:\DOCUMENTS AND SETTINGS\" & struser & "\LOCAL SETTINGS\TEMPORARY INTERNET FILES") Then
objfso.DeleteFile "C:\DOCUMENTS AND SETTINGS\" & struser & "\LOCAL SETTINGS\TEMPORARY INTERNET FILES\*.*",Force
Else
Wscript.Echo "Folder does not exist."
End If
If objFSO.FolderExists("C:\Documents and Settings\" & struser & "\Application Data\ICAClient\Cache") Then
objfso.DeleteFile "C:\Documents and Settings\" & struser & "\Application Data\ICAClient\Cache\*.*",Force
Else
Wscript.Echo "Folder does not exist."
End If
If objFSO.FolderExists("C:\Documents and Settings\" & struser & "\Application Data\Juniper Networks\EPCheck") Then
objfso.DeleteFile "C:\Documents and Settings\" & struser & "\Application Data\Juniper Networks\EPCheck\*.*",Force
End If
set wshNetwork = Nothing
set objFSO = Nothing