Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
May 26, 2013, 04:16:15 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Windows-PE Defrag batch file  (Read 4374 times)
Huggu
JkDefrag Hero
*****
Posts: 58


View Profile
« on: March 27, 2009, 11:23:45 am »

Hi.
I want to share with you some ideas about optimizing my Windows-XP system volume C: from Windows-PE.
Why windows-pe? Windows-pe is a great emergency boot os based on windows vista. it is small (approx 200kByte on my usb stick) , configurable and free of any costs. All files on drive C: can be optimized from windows-pe as posible from a boot time defragger.

The boot file optimization only works when MyDefrag finds c:\windows\prefetch\layout.ini
therefore i copy this file from c: to my ramdisk before i start MyDefrag
Code:
md        %windir%\prefetch
copy      c:\windows\prefetch\layout.ini %windir%\prefetch\layout.ini

Anyway MyDefrag does not touch some files. for instance:
c:\windows\system32\config\*.log
You might want to delete those files to optimize defrag results.
Code:
attrib -h c:\WINDOWS\system32\config\*.LOG
del       c:\WINDOWS\system32\config\*.LOG

finally i start MyDefrag ... to run overnight Wink
Code:
start mydefrag -r slowoptimize.myd c: -u "eigene dateien"

here the entire Script DefragPE.cmd
Code:
@echo off
rem this script should be used from Windows PE to slow optimize system disk c: =================
rem Disk c: should be mounted as C: in Windows-XP and Windows-PE
rem
rem copy layout.ini to allow boot file optimization --------------------------------------------
rem
md        %windir%\prefetch
copy      c:\windows\prefetch\layout.ini %windir%\prefetch\layout.ini

rem delete system logs to avoid fragmented files -----------------------------------------------
rem
attrib -h c:\WINDOWS\system32\config\*.LOG
del       c:\WINDOWS\system32\config\*.LOG

rem start mydefrag -----------------------------------------------------------------------------
rem
start mydefrag -r slowoptimize.myd c: -u "eigene dateien"

Any improvements welcome Smiley
Logged
jimbo
JkDefrag Hero
*****
Posts: 84


View Profile
« Reply #1 on: March 27, 2009, 11:34:18 am »

Uhhh, those files that you are deleting, c:\windows\system32\config\*.log, are actually kinda important.

They are not "log files" in the sense that you probably think. They are not debug/diagnostic/informational output in text for later monitoring.

They are the journalling logs for the windows registry. They are critical in being able to automatically repair and reconstruct the main registry database files in the event that there is every any corruption, or if the system didn't shut down perfectly cleanly.

90%+ of the time, when everything was tidy and the registry database files were correctly flushed out in a consistent state, it won't do any harm to delete them, but on the odd occasion when there is anything even slightly "odd" about the database files, you will be left with a system that is non-bootable. I recently had to repair a machine that wouldn't boot, wouldn't boot to safe mode, wouldn't boot to a repair console, wouldn't even boot off a windows CD to reinstall - all because of a tiny corruption in the system registry hive.

I would strongly urge that you not delete these logfiles automatically, or, for that matter, at all.
Logged
Huggu
JkDefrag Hero
*****
Posts: 58


View Profile
« Reply #2 on: March 27, 2009, 11:55:28 am »

You are right. Those log files are the event logs for system, applications and so on. As long you need to document those events, dont delete the log files .... or export them before deleting.

When i want to use my win-pe defrag script, i shutdown my running Windows-XP and reboot into my stick-windows-pe. so i know, my windows is well and it should be able to boot again after Defraing.

If you dont like to do so, feel free to delete the command from the batch file.
Logged
toyotabedzrock
Newbie
*
Posts: 2


View Profile
« Reply #3 on: September 02, 2009, 07:48:50 pm »

Whats the "-u" switch do? I don't see it in the help file anywhere.
Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #4 on: September 02, 2009, 08:20:12 pm »

Whats the "-u" switch do? I don't see it in the help file anywhere.
The MyDefrag command line syntax changed after these postings ware made, Changelog.

jonib
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!