Jump to content

Scripting Defrag in Windows 2000


Guest jsuknaic
 Share

Recommended Posts

Guest jsuknaic

I am new to this tool and I have been trying to script the use of the defrag tool provided in Windows 2000. Below is how the script is written:

Run, %systemroot%\\system32\\dfrg.msc

Winwaitactive, Disk Defrag

Send, {ALTDOWN}A{ALTUP}D

Winwaitactive, Defragmentation Complete

Send, {TAB}{ENTER}

Winwaitactive, Disk Defrag

Send, {ALTDOWN}{F4}{ALTUP}

When I run the script I get an error message that states the following:

Line 1:

Run, C:\\WINNT\\system32\\dfrg.msc

Error: unable to run program. (Ensure that backslashes \ have been used properly).

I have checked the location of the file and all appears well. I can use this command (the first line) to run notepad.exe. I think it may have something to do with executing an .msc file, but I am not sure. Can anyone help me?

Link to comment
Share on other sites

  • Developers

Don't think it works in Win2K....

There is a utility that helps out called autodefrag http://www.morphasys.com/autodefrag/

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...