?
Solved

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

Posted on 2009-07-08
4
Medium Priority
?
436 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 750 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 750 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 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