BoardBabe Posted March 18, 2005 Share Posted March 18, 2005 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. Link to comment Share on other sites More sharing options...
bledd Posted March 18, 2005 Share Posted March 18, 2005 (edited) for deleting temp files, this may be of use to you del "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temp" /qrd "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temp" /s /qdel "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temporary Internet Files" /qrd "%systemdrive%\Documents and Settings\Administrator\Local Settings\Temporary Internet Files" /s /qdel "%userprofile%\Local Settings\Temp" /qrd "%userprofile%\Local Settings\Temp" /s /qmkdir "%userprofile%\Local Settings\Temp"del C:\Recycled\?*.* /qrd C:\Recycled /s/qdel C:\Recycler\?*.* /qrd C:\Recycler /s/qdel "%userprofile%\Local Settings\Temporary Internet Files" /qrd "%userprofile%\Local Settings\Temporary Internet Files" /s /q Edited March 18, 2005 by Alanoll Link to comment Share on other sites More sharing options...
BoardBabe Posted March 18, 2005 Author Share Posted March 18, 2005 Thanks, but thats not what im after Im after a method to defrag systemdrive Link to comment Share on other sites More sharing options...
SilverHaze420 Posted March 18, 2005 Share Posted March 18, 2005 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! Link to comment Share on other sites More sharing options...
BoardBabe Posted March 18, 2005 Author Share Posted March 18, 2005 Hehe.Can i call in a .cmd the following?@echo offstart /wait defrag.exe %systemdrive%EXIT? Link to comment Share on other sites More sharing options...
bucketbuster Posted March 18, 2005 Share Posted March 18, 2005 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. Link to comment Share on other sites More sharing options...
BoardBabe Posted March 18, 2005 Author Share Posted March 18, 2005 Only one way to find out then Link to comment Share on other sites More sharing options...
durex Posted March 18, 2005 Share Posted March 18, 2005 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! Link to comment Share on other sites More sharing options...
BoardBabe Posted March 18, 2005 Author Share Posted March 18, 2005 Im going to try defrag.exe first. Can't see why that should'nt work. Link to comment Share on other sites More sharing options...
erik_demon Posted March 18, 2005 Share Posted March 18, 2005 defrag.exe %systemdrive% -fIn 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 helpIt works @bledd:Yes, just what I was looking for!! Thanks Link to comment Share on other sites More sharing options...
durex Posted March 18, 2005 Share Posted March 18, 2005 Viva la Diskeeper! Windows Defrag sucks! heh.... Link to comment Share on other sites More sharing options...
bledd Posted March 18, 2005 Share Posted March 18, 2005 if anyone knows anywhere else I should add to that list, please tell me..the recycled is for win2k, recycler is winxpI've created that to run at login in our login script at work Link to comment Share on other sites More sharing options...
BoardBabe Posted March 18, 2005 Author Share Posted March 18, 2005 why do you both rd and del??? Link to comment Share on other sites More sharing options...
DigitalAZ Posted March 18, 2005 Share Posted March 18, 2005 if anyone knows anywhere else I should add to that list, please tell me..the recycled is for win2k, recycler is winxpI've created that to run at login in our login script at work<{POST_SNAPBACK}>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 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" Link to comment Share on other sites More sharing options...
lloyd33 Posted March 21, 2005 Share Posted March 21, 2005 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' Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now