No announcement yet.

Deleting roaming profiles vb script

  • Filter
  • Time
  • Show
Clear All
new posts

  • Deleting roaming profiles vb script

    Hi people,

    I have zero scripting experience. What I want to do is at logoff delete the userprofile by username. Yes the complete folder from \\filserver\%username% where the username should be the profile t odelete. This because we have a citrix environment where for this application we need to do this. I thought of smth like this. But this doesn't work can anyone tell me what is wrong?

    dim filesys,login
    Set filesys = CreateObject("Scripting.FileSystemObject")
    set WshNetwork = WScript.CreateObject("WScript.Network")

    login = Wshnetwork.Username

    If filesys.FolderExists("c:\Profiles\%login%") Then
    filesys.DeleteFolder "c:\Profiles\%login%"

    End If

    Another thing is that before deleting these profiles i need to copy a folder the favorites folder which at logon i want to import again. I know it sounds complicated. can Anyone help?