Solved

Script to delete all documents from My Documents and Desktop of a specific user

Posted on 2009-07-08
4
435 Views
Last Modified: 2012-05-07
Hi, I am looking for a log on or log off script which can be pushed out with group policy which will delete all documents in the My Documents and Desktop of a specific user.

The script should proceed on errors and hopefully leave a log file of results (files skipped and deleted) in the c:\

Thanks!
0
Comment
Question by:susnewyork
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 66

Expert Comment

by:johnb6767
ID: 24807324
Would a Mandatory Profile be an option for you? If you are only looking to delete from those two folders, maybe not, but if you want NO changes saved at logoff, might be an option....
 Create an XP Pro Mandatory User Profile on the Local Machine
http://www.softwaretipsandtricks.com/windowsxp/articles/457/1/Create-an-XP-Pro-Mandatory-User-Profile-on-the-Local-Machine
Might not be what you need, but thought I would offer....
0
 
LVL 11

Accepted Solution

by:
loftyworm earned 250 total points
ID: 24807364
Her si a fast brain dump
make 2 batches.  the first does the work, the second starts the first file and logs its progress.

TEST TEST TEST!!!!!!


:::::::::::::::::::::
:::: file_clean.bat
::::::::::::::::::::::
 
del /f /y C:\documents and settings\user\desktop\
del /f /y C:\documents and settings\user\Mydocuments\
 
:::::::::::::::::::
:::: Run_and_log.bat
:::::::::::::::::::
start File_clean.bat >> log.txt

Open in new window

0
 
LVL 1

Author Comment

by:susnewyork
ID: 24807473
Mandatory profile is definatly not an option for me.
0
 
LVL 66

Assisted Solution

by:johnb6767
johnb6767 earned 250 total points
ID: 24831650
Is this going to be the currently logged in user, so the same script will need to run on each PC?
I would actualy use the following syntax.....
del /f /y %USERPROFILE%\desktop\*.*
del /f /y %USERPROFILE%\user\Mydocuments\*.*
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question