[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VBS Script to defragment windows 2003 and 2008 server

Posted on 2011-02-22
3
Medium Priority
?
488 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
ID: 34958004
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
ID: 34958036
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 2000 total points
ID: 34958037
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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

873 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