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.

Defrag %systemdrive% At Cleanup.cmd

Featured Replies

How do I defrag systemdrive silently at cleanup.cmd?

I am using WPI, called (WPI.cmd) from RunOnceEx part of winnt.sif. At the end of WPI i call cleanup.cmd that deletes shortcuts and tempfiles. WPI.cmd reboots at the very end. So the best would be to have a defragment at the end of cleanup.cmd.

for deleting temp files, this may be of use to you :)

del "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temp" /q
rd "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temp" /s /q
del "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temporary Internet Files" /q
rd "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temporary Internet Files" /s /q
del "%userprofile%\Local Settings\Temp" /q
rd "%userprofile%\Local Settings\Temp" /s /q
mkdir "%userprofile%\Local Settings\Temp"
del C:\Recycled\?*.* /q
rd C:\Recycled /s/q
del C:\Recycler\?*.* /q
rd C:\Recycler /s/q
del "%userprofile%\Local Settings\Temporary Internet Files" /q
rd "%userprofile%\Local Settings\Temporary Internet Files" /s /q

Edited by Alanoll

  • Author

Thanks, but thats not what im after :)

Im after a method to defrag systemdrive

But that is great for me! I was actually looking for something I can just run quickly to delete all the temp files but have not gotten around to doing it myself! Thanks!

  • Author

Hehe.

Can i call in a .cmd the following?

@echo off

start /wait defrag.exe %systemdrive%

EXIT

?

I don't know for sure but I believe that MS Defrag has commandline support.

So with the appropriate switches you could call it at the end of your batchfile.

If you use Diskeeper for defraggin (which you should be if youre not), theres this thread that walks you through it...

It seemed a bit involved when I first took a peak at it so I never bothered in getting around to trying it, but give it a shot if youre determined to do so!

Let us know how it works out!

defrag.exe %systemdrive% -f

In dutch:

defrag.exe <volume> [-a] [-f] [-v] [-?]
 volume  Stationsletter of koppelpunt (d: of d:\vol\koppelpunt)
 -a      Alleen analyseren
 -f      Forceert defragmentatie, ook als de beschikbare ruimte klein is
 -v      Uitgebreide weergave
 -?      Deze hulptekst weergeven.

In English (there could be some translation errors) :

defrag.exe <volume> [-a] [-f] [-v] [-?]
-a        only analyse
-f        force defregmantation, also if available space is low
-v       show advanged view
-?        show help

It works :thumbup

@bledd:

Yes, just what I was looking for!!

Thanks :thumbup

if anyone knows anywhere else I should add to that list, please tell me..

the recycled is for win2k, recycler is winxp

I've created that to run at login in our login script at work

if anyone knows anywhere else I should add to that list, please tell me..

the recycled is for win2k, recycler is winxp

I've created that to run at login in our login script at work

Here is what I use. You should create another thread for this topic I bet alot of people have stuff we haven;t listed here and may not see this conversation since the topic is related to Defrag :P

ECHO Removing useless shortcuts...
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Windows Update.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Set Program Access and Defaults.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Windows Catalog.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\MSN.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Windows Messenger.lnk"
DEL "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Windows Movie Maker.lnk"
RD /S /Q  "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Games"
RD /S /Q  "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Accessories"
RD /S /Q  "%USERPROFILE%\Start Menu\Programs\Accessories"
DEL "%USERPROFILE%\Start Menu\Programs\Internet Explorer.lnk"
DEL "%USERPROFILE%\Start Menu\Programs\Outlook Express.lnk"
DEL "%USERPROFILE%\Start Menu\Programs\Remote Assistance.lnk"
DEL "%USERPROFILE%\Start Menu\Programs\Windows Media Player.lnk"

ECHO Removing useless shortcuts...

RD /S /Q "%systemdrive%\Documents and Settings\All Users\Start Menu\Programs\Accessories"

Sure... I suppose I don't need to get to Defrag.... or Wordpad... or Calculator....

Kinda harsh don't ya think?

'33'

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.