Hi Guys and Girls - We want to be able to run a .VBS script at logon that will delete profiles older than 30 days. I have the script below. However I want to set it to delete profiles older than 30 days (without a prompt) and remove the other prompts (are you sure etc). Can anyone help!? I'm relatively new to scripting. Thank you in advance!
- VBS code snippet -
If Not colProfiles Is Nothing Then
For Each objProfile in colProfiles
'Converting a Standard Date to a WMI Date-Time Format
dtmLastUseTime = CDate(Mid(objProfile.LastUseTime, 5, 2) & "/" & Mid(objProfile.LastUseTime, 7, 2) & "/" & Left(objProfile.LastUseTime, 4) & " " & Mid (objProfile.LastUseTime, 9, 2) & ":" & Mid(objProfile.LastUseTime, 11, 2) & ":" & Mid(objProfile.LastUseTime, 13, 2))
intUnusedDay = DateDiff("d", dtmLastUseTime, Date)
If intUnusedDay = CInt(intDay) Then
...