ICC Home  /  Members  /  Meetings  /  Peer Support  /  Documentation  /  Projects

The DeleteCookie.vbs script

Return to IT/SA Services Documentation: Active Directory


This script was temporarily added to the IFAS logon script to assist with the transition to using "GatorLinkUsername@ufl.edu" addresses. Listserv owners and editors may have had an incorrect cookie stored for their old listserv logons, and this will help remove those. The intention is to leave this in until February 2006.

The code

The first couple of lines set up objects and the next several set the environment variables for "homedrive", "homepath", and "username". Then the script attaches to the pertinent cookie file and if that file was created prior to the first of the year, the file is deleted.

on error resume next
Set objShell = WScript.CreateObject("WScript.Shell")
Set colProcessEnvVars = objShell.Environment("Process")
Drive = colProcessEnvVars("HOMEDRIVE")
Path = colProcessEnvVars("HOMEPATH")
Username = colProcessEnvVars("USERNAME")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(Drive & "\" & Path & "\Cookies\" & Username & "@lists.ifas.ufl[1].txt")
If objFile.DateCreated < "01/01/2006" then
	objFSO.DeleteFile(Drive & "\" & Path & "\Cookies\" & Username & "@lists.ifas.ufl[1].txt")
End If

last edited 23 January 2006 by Steve Lasley