PC cleanup before sysprep

Posted on 2013-09-16
Medium Priority
Last Modified: 2013-09-25
Hi, just wondered if anyone had created their own custom batch script to cleanup a pc (internet files, desktop etc) before syspreping?

here is an example of mine, just wondered if there was something I should add/change etc, thanks

del /F /S /Q "%systemroot%\temp\*.*"
del /F /S /Q "%systemroot%\Prefetch\*.*"

set Temp=C:\Users\%username%\AppData\Local\Temp

del /q /S /f "%Temp%"
rd /s /q "%Temp%"

set History=C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\History

del /q /s /f "%History%"
rd /s /q "%History%"

set IETemp=C:\Users\%USERNAME%\AppData\Local\Microsoft\Windows\Tempor~1

del /q /s /f "%IETemp%"
rd /s /q "%IETemp%"

set Cookies=C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Cookies

del /q /s /f "%Cookies%"
rd /s /q "%Cookies%"

del /F /S /Q "%homepath%\recent\*.*"
del /F /S /Q "%userprofile%\Desktop\*.*"
del /F /S /Q "C:\Users\Default\Desktop\*.*"
del /F /S /Q "C:\Users\Public\Desktop\*.*"

rd /s C:\$Recycle.Bin
Question by:kwatt562
  • 2
LVL 22

Expert Comment

by:Adam Leinss
ID: 39496254
I just run CCleaner: http://www.piriform.com/ccleaner

Why re-invent the wheel?

Author Comment

ID: 39496364
Don't really want it on the PC, as its for corporate, but thanks
LVL 22

Expert Comment

by:Adam Leinss
ID: 39496402
There are portable versions of CCleaner...no need to install it.

LVL 50

Accepted Solution

jcimarron earned 2000 total points
ID: 39496841

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

607 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