Solved

VBS Script to defragment windows 2003 and 2008 server

Posted on 2011-02-22
3
476 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:Gerhardpet
3 Comments
 
LVL 1

Author Comment

by:Gerhardpet
Comment Utility
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
 
LVL 16

Expert Comment

by:sjklein42
Comment Utility
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
 
LVL 8

Accepted Solution

by:
jimsweb earned 500 total points
Comment Utility
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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now