VBS Script to defragment windows 2003 and 2008 server

I need a VBS script to defragment the hard drive/partitions on Window 2003 and 2008 including R2 server.

I need to be able to specify the drives/partition e.g. C: D: etc...

Can someone help me out?
LVL 1
GerhardpetAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jimswebConnect With a Mentor Commented:
I found an interesting article for the same, but it doesn't use VBS, instead it relies on BAT file. Please have a look at it, may be of some help to you.
http://www.windowsitpro.com/article/windows-shell-bat-and-cmd/automate-the-windows-2003-defragmenter-without-paying-extra.aspx
0
 
GerhardpetAuthor Commented:
I should have explained a bit more...

I want to set the script up on a schedule to run the windows build in defragmentation.
0
 
sjklein42Commented:
You can schedule the following DOS commands.  You do not necessarily need to use VBS script. You can use the built-in Windows Task Scheduler, too.

defrag c:
defrag d:

Open in new window

http://support.microsoft.com/kb/283080/EN-US
0
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.

All Courses

From novice to tech pro — start learning today.