Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

Delete unused profiles on Workstation

  • Filter
  • Time
  • Show
Clear All
new posts

  • Delete unused profiles on Workstation


    I am trying to put a VBS script together that will delete local profiles that have not been used in the last 180 days but not delete the Vendor or Administrator profile.

    I have is working at a bat file but have not been successful at getting to work as a VBS

    This is what is in the .bat:
    Touch -a -m -c "C:\Documents and Settings\Administrator\NTUSER.dat"

    Touch -a -m -c "C:\Documents and Settings\Vendor\NTUSER.dat"

    delprof /q /i /d:180

    I have found a way to get Delprof to run in a VBS using this:
    Set objShell = WScript.CreateObject("WScript.Shell")
    objShell.Run "delprof.exe /q /i /d:185", MAXIMIZE_WINDOW

    However I have not been successful getting Touch to run in a VBS.

    I was hoping someone would know the correct syntax to allow Touch to run with the above switches and would be willing to help out someone that is really new to VBS.

    Also it there a way to flag the entire VBS to run silently so the client is not aware this script is running?

    Thank you for your time I would apperciate any insight you can offer.