VB Scripts to Prevent users from saving anything on desktop

Print Friendly, PDF & Email


I have coded a pair of scripts to  ensure that no data is saved on desktop by the user. The scripts have been tested on a Windows 2008 R2 server with XP (23bit) and Windows 7(32 bit ) clients. First script executes when the user logs off and the second when the user logs in
Logoff script name : desktop_backup.vbs
login Script: deferred_backup.vbs
The log off script moves all the contents of desktop to server. The second script (login) is primarily a backup script , aim to move contents to desktop just in case there is an network interruption. The log off script works in the following manner             Move contents of desktop to a temp folder in the users home directory.
the temp folder is named  in following format (DD-MM-YYYY@hhmm-computer_netbios_name)
Just in case desktop folder gets deleted (due to move action), recreate the folder
Check whether the temp folder is empty (in case the user desktop is empty) , if yes delete the temp folder,
if no proceed with moving action
create a folder with same name  as temp folder on server.
If no joy (indicating permissions or network error), create a deferred folder for move while logging in and move contents there.

The login script works in following manner
            Check if deferred folder exists (indicating that there was a network error during logoff), try move to server again
            if no joy then proceed and wait till share is restored.

Both the scripts are heavily commented for customisation
Hope they are useful.

Ishan Karve

About Ishan Karve

Ishan Karve is just an every day normal guy next door who happens to be an Electronics Engineer by profession and dabbles with PHP, Javascript, C++ and python. His interests vary as seasons change.. they change from astronomy to soul searching. This site is just a reflection of what he does to keep his mind engaged when he is not occupied by work and family. He is an extremely objective guy and is always ready for some good arguments.. of course over a glass of 40% proof alcohol.
This entry was posted in Programming, VB Script and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *