I have had disk issues with users using Terminal Servers in Windows 2003

I have a Windows 2003 Terminal Server environment.  Users do not have roaming profiles, therefore, they are saving all sorts of documents on their desktops and deleting items that just sit in the users recycle bin.

Does anyone have a script that I could run which would delete all users contents from the recycle bin ?
CaussyRAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SjoerdvWCommented:
Take a look at this URL: http://social.technet.microsoft.com/Forums/en/ITCG/thread/7ae0bc10-5c17-44e9-9192-9c5de54b7072

discuss you're question with some sample code...
0
CaussyRAuthor Commented:
Thanks - I have seen this, but how do I run the script. I am running XP SP3, and I tried to run cscript rcb.vbs but the command does not exist. Do I need to install something in XP ?
0
SjoerdvWCommented:
try wscript rcb.vbs (or just double click the script).
The script will not give any output, but empty all users recycle bins...
Const strRecycler = "\\RECYCLER\\"
Set objSWbemServices = GetObject _
    ("WinMgmts:Root\Cimv2")
Set colUsers = objSWbemServices.ExecQuery _
    ("Select * From Win32_UserAccount")
For Each objUser In colUsers
    Set colDisks = objSWbemServices.ExecQuery _
        ("Select * From Win32_LogicalDisk " & _
        "Where DriveType = 3")
    For Each objDisk In colDisks
        Set colDeletedFiles = objSWbemServices.ExecQuery _
        ("Select * From Cim_DataFile Where Drive = '" _
        & objDisk.DeviceId _
        & "' And Path = '" & strRecycler & objUser.Sid & "\\' " _
        & "And Hidden = False")
        For Each objDeletedFile In colDeletedFiles
            objDeletedFile.Delete
        Next
        Set colDeletedFolders = objSWbemServices.ExecQuery _
        ("Select * From Win32_Directory Where Drive = '" _
        & objDisk.DeviceId _
        & "' And Path = '" & strRecycler & objUser.Sid & "\\' " _
        & "And Hidden = False")
        For Each objDeletedFolder In colDeletedFolders
            objDeletedFolder.Delete
        Next
    Next
Next

Open in new window

0
CaussyRAuthor Commented:
Hi SjoerdvW,

I tried the script but it didn't do anything ... :o(
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.