Quantcast

Maximum PC

It is currently Sat Oct 25, 2014 5:26 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Windows XP housecleaning.bat
PostPosted: Mon Jul 14, 2008 12:13 pm 
team psycho or sumthin
team psycho or sumthin
User avatar

Joined: Mon Aug 09, 2004 2:58 am
Posts: 6498
Location: I live on the verge of insanity
Using eraser

housecleaning.bat

Code:
@echo off

c:\progra~1\eraser\eraserl -recycled -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\docume~1\<me>\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\<me>\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\<me>\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\<me>\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\<me>\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\<me>\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\<me>\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\windows\temp" -subfolders -keepfolder -method DoD_E -queue -silent

RegEdit /s c:\housecleaning.reg


housecleaning.reg

Code:
Windows Registry Editor Version 5.00

'cleans IE URL drop down list typed urls and recent docs, etc.
[-HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComputerDescriptions]
[-HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru]
[-HKEY_USERS\S-1-5-21-191630191-1452435383-2320090250-1007\Software\Microsoft\Internet Explorer\TypedURLs]
[-HKEY_USERS\S-1-5-21-191630191-1452435383-2320090250-1007\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU]


'Delete RunMRU's
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU]


'Delete OpenSaveMRU's
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32]


'Delete RecentDocs
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs]


'Delete OpenWithList
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts]


'Delete UserAssist Info
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist]


'Delete MediaPlay Recent List
[-HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentFileList]
[HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentFileList]

Am I missing anything or doing anything wrong?
Fairly sure that.
Code:
[-HKEY_USERS\S-1-5-21-191630191-1452435383-2320090250-1007\Software\Microsoft\Internet Explorer\TypedURLs]
[-HKEY_USERS\S-1-5-21-191630191-1452435383-2320090250-1007\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU]

Is different on every PC.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 2:49 pm 
team psycho or sumthin
team psycho or sumthin
User avatar

Joined: Mon Aug 09, 2004 2:58 am
Posts: 6498
Location: I live on the verge of insanity
housecleaning.batv0.1.1


Code:
@echo off
echo Please enter your user name
set /p Username=

c:\progra~1\eraser\eraserl -recycled -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Administrator\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\All Users\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\Default User\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username%\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username%\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username%\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username%\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username%\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username%\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username%\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

c:\progra~1\eraser\eraserl -folder "c:\windows\temp" -subfolders -keepfolder -method DoD_E -queue -silent

:proceed
cls
echo.
echo Would you like clean another account?
echo.
echo Type y or n and press Enter
set /p ok=
if ‘%ok%’ == ‘y’ goto yes
if ‘%ok%’ == ‘Y’ goto yes
if ‘%ok%’ == ‘n’ goto no
if ‘%ok%’ == ‘N’ goto no
cls

:yes
echo Please enter your user name
set /p Username1=
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username1%\cookies" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username1%\locals~1\temp" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username1%\locals~1\Tempor~1" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username1%\locals~1\History" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username1%\recent" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username1%\userdata" -subfolders -keepfolder -method DoD_E -queue -silent
c:\progra~1\eraser\eraserl -folder "c:\docume~1\%username1%\micros~1\office\recent" -subfolders -keepfolder -method DoD_E -queue -silent

cls
goto proceed

:no
RegEdit /s c:\housecleaning.reg


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jul 15, 2008 4:25 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
Just wondering why you are doing this rather than just running CCleaner or something? What advantage do you gain? It looks interesting otherwise.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jul 15, 2008 5:12 am 
team psycho or sumthin
team psycho or sumthin
User avatar

Joined: Mon Aug 09, 2004 2:58 am
Posts: 6498
Location: I live on the verge of insanity
What better way to learn where windows keeps its garbage?

Besides, I just like the idea of the trash getting a tortureous death from eraser.


My next step on this is figuring out how to modify the registry without using a .reg file, I'm fairly sure it can be done within a batch file.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jul 15, 2008 7:40 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
Yeah. You could write an app in C# to read the registry and you can read a text file with a list of keys to do whatever with... I can dig up some code if you want some. (I will probably do it anyway).


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jul 15, 2008 7:48 am 
SON OF A GUN
SON OF A GUN
User avatar

Joined: Mon Nov 01, 2004 5:41 am
Posts: 11605
Everything you need to work with the registry is in Microsoft.Win32

It is pretty easy to use. I was going to post some code, but it is kind of specific to the registry key you are trying to get to.


Last edited by CrashTECH on Tue Jul 15, 2008 11:38 am, edited 1 time in total.

Top
  Profile  
 
 Post subject:
PostPosted: Tue Jul 15, 2008 10:17 am 
Million Club - 5 Plus
Million Club - 5 Plus
User avatar

Joined: Fri Apr 25, 2008 6:35 am
Posts: 1998
I remember .bat files :)

this section:

Code:
:proceed
cls
echo.
echo Would you like clean another account?
echo.
echo Type y or n and press Enter
set /p ok=
if ‘%ok%’ == ‘y’ goto yes
if ‘%ok%’ == ‘Y’ goto yes
if ‘%ok%’ == ‘n’ goto no
if ‘%ok%’ == ‘N’ goto no
:yes
echo Please enter your user name
set /p Username1=
[..yes code here]


if anything but Y,y,N or n is entered (for example "no" <ENTER> or some other typo) it will fall through the test and execute the "yes" code when you perhaps didnt want to. so you could shorten it plus reduce the chance of user error in a fail safe kinda way with this change. this way if you do a typo it will simply exit and you can just rerun it, whereas the other way a typo leaves you at the username prompt with no graceful way to exit (control-c anyone?).

Code:
:proceed
cls
echo.
echo Would you like clean another account?
echo.
echo Type y <ENTER> for yes or just <ENTER> for no
set /p ok=
if ‘%ok%’ == ‘y’ goto yes
if ‘%ok%’ == ‘Y’ goto yes
goto no
:yes
echo Please enter your user name
set /p Username1= [..yes code here]


or this way (even simpler), where you just hit <ENTER> to exit, anything else is assumed to be an account name.

Code:
:proceed
cls
echo.
echo Would you like clean another account?
echo.
echo Type name of account <ENTER> or just hit <ENTER> to exit.
set /p username1=
if  ‘%username1%’ == ‘’ goto no
[..yes code here]



also in the :no code you should delete the variables used so they dont hang around in the environment, just on general principles.. plus you never know if you might need the extra 20 or so bytes of RAM, heh.

Code:
:no
set username=
set username1=
set ok=
[..rest of no code here]

not that theres anything wrong with your way (hope you dont think Im criticizing, Im not), I just always look for ways to simplify code and make it more fail safe :)


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© 2014 Future US, Inc. All rights reserved.