Announcement

Collapse
No announcement yet.

logon scritp

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • logon scritp

    I would like to run a script in the logon in workstations of xp through the A.C

    so that scripts clean and delete all the files in the TEMP folder when the user logons .

    Is there a script to do that ?

    Thank You

  • #2
    This script in its current form will delete temp internet files. You can easily modify it to also delete temp files in other locations. FYI, it works best as a logoff script due to rights issues.

    Code:
    on error resume next 
    Set fs = CreateObject ("Scripting.fileSystemObject") 
    
    Set WshShell = WScript.CreateObject ("Wscript.Shell") 
    osdir = WshShell.ExpandEnvironmentStrings ("%userprofile%") 
    Set f = fs.GetFolder(osdir) 
    
    f = f + "\Local Settings\Temporary Internet Files" 
    
    if (fs.FolderExists(f)) Then 
     fs.DeleteFolder f,True 
    end if
    Andrew

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment

    Working...
    X