How to start windows defragmentation process

D

docholiday

Hello group,

I am currently working on an application that makes heavy use of a
postgres database. Millions of rows are moved around during an average
day. As this application is meant to be deployed to several thousand
customers, we have added a couple of maintenance operations to the
application, in order to keep the database in shape.

We would also like to introduce buttons, which would then start the
defragmentation process of the os, if available. The application is
targeted for 2000, XP and Vista. Is there a simple way to start the
default defragmentation tool (it just needs to be launched, the
defragmentation process itself does not need to be started or
configured).

Sincerly,
Michael Donn
 
M

Martin Priebe

Find out the os and search for the file.



Example for Windows XP.

string text = @"C:\WINDOWS\system32\dfrg.msc";

System.Diagnostics.ProcessStartInfo proc = new
System.Diagnostics.ProcessStartInfo();

proc.FileName = text;

System.Diagnostics.Process.Start(proc);



This will start the defragmentation dialog.

But the windows defrag is not so good.

U can also install a 3rd Party Tool like AusLogics DiskDefrag and start this
one.

Just edit the path to the exe file.



greetings

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top