Welcome to MSDN Blogs Sign in | Join | Help

jaredpar's WebLog

Code, rants and ramblings of a programmer.

Syndication

News

Now Reading

Expert F#

What's a better book to read when learning F#?

Essential WPF

Thus far the best book I've read on WPF. Gets right down to working with WPF and the goals/history.

Purely Functional Data Structures

Reading this book makes me feel like I'm back in college. It will really get your mind going and is best read with a whiteboard handy.


Using PowerShell to make sure your XP machine is defragmented

Quick script you can run at login to ensure that your XP machine is being defragmented.  I chose 1:00 AM every evening but you can quickly alter that in the script.  I have this script run as part of my regular set of configuration scripts to ensure that my XP machines are in good shape.

$script:title = "Xp Regular Degrag"
if ( 5 -ne [Environment]::OsVersion.Version.Major ) {
    return;
}
$found = schtasks /query | ?{ $_ -match "^\w*$title" } | test-any
if ( $found ) {
    return
}
# Set up the defrag task
$task = "{0} {1}" -f (join-path $env:WinDir "System32\defrag.exe"),$env:SystemDrive
schtasks /create /ru system /tn $title /sc daily /st "01:00:00" /tr $task

Published Friday, June 13, 2008 8:00 AM by Jared Parsons

Filed under:

Comments

No Comments

New Comments to this post are disabled
Page view tracker