Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Automating Defrag with defrag.exe

Featured Replies

I created a script that defrags a computers 2 volumes and then restarts. I am not using the /noprompt switch because when I did use it, the computer would reboot while it was running.

As a test I changed the script to just run the defrag on the one drive, which uses the following cmd:

defrag c: /f

Now It just has a DOS box up with fragmentation stats on it but doesn't seem to be doing anything. The computer isn't locked up, but the HD LED is on constant. Task Manager shows 00:00 for CPU time for defrag.exe.

Is this normal for it to take a long time and not seem to be doing anything??

I created a script that defrags a computers 2 volumes and then restarts. I am not using the /noprompt switch because when I did use it, the computer would reboot while it was running.

As a test I changed the script to just run the defrag on the one drive, which uses the following cmd:

defrag c: /f

Now It just has a DOS box up with fragmentation stats on it but doesn't seem to be doing anything. The computer isn't locked up, but the HD LED is on constant. Task Manager shows 00:00 for CPU time for defrag.exe.

Is this normal for it to take a long time and not seem to be doing anything??

I keep my HD squeaky clean and defragmented on a weekly basis so I'm probably not seeing the same thing you are.

I just ran defrag C: /v from a command prompt, /v because I wanted to see the full report of what it found.

It only ran for about five minutes and gave me a real nice status report.

I normally just run defrag from a desktop icon and let it do its thing while I do something else.

I enjoy watching the little red lines disappear and the white spaces get filled up with blue. :thumbup

Cheers Mate!

Andromeda43 B)

I created a script that defrags a computers 2 volumes and then restarts. I am not using the /noprompt switch because when I did use it, the computer would reboot while it was running.

........

Now It just has a DOS box up with fragmentation stats on it but doesn't seem to be doing anything. The computer isn't locked up, but the HD LED is on constant. Task Manager shows 00:00 for CPU time for defrag.exe.

Is this normal for it to take a long time and not seem to be doing anything??

It only displays what it found before defragging. It is not a dynamic page. It does take a while depending on a lot of different factors. If you want a dynamic display from the command line, use DirMS.

As far as the restart while it runs, try using this:

start /wait defrag c: -f

The "start /wait" tells windows to run the command, but wait for it to finish to run the next command.

Hope this helps.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.