GLO Posted October 28, 2004 Share Posted October 28, 2004 Hi, im trying to set up a scheduled task to defrag the hard drive.However defrag is not a standard option, so i have selected the corresponding dfrg.msc file from the system32 folder to run at a scheduled time, but it wont run at all!How can i schedule a defrag? Link to comment Share on other sites More sharing options...
oftentired Posted October 28, 2004 Share Posted October 28, 2004 Schedule a Task to Defragment Drives Link to comment Share on other sites More sharing options...
GLO Posted October 28, 2004 Author Share Posted October 28, 2004 Thanks oftentired, but those instructions are out of date for SP2.Never the less, i was selecting the incorrect dfrg files.BUT now that i have selected the defrag.exe file, when i right click it in scheduled tasks, it quickly opens a command window then closes it within 1 second and displays that it has already run; which i can see and hear that it hasnt.What else can i try? Link to comment Share on other sites More sharing options...
oftentired Posted October 28, 2004 Share Posted October 28, 2004 Defrag is a task that may require administrative credentials. If you are not logged on with an admin account it may not run as expected.FYI here is the Knowledgebase article describing the new features for SP2New features of the Scheduled Tasks Control Panel item that are included in Windows XP Service Pack 2I avoid these types of issues with XP by dual booting with 98 and using Geodisk2 for scandisk and defrag. Works like a charm with no hassle Link to comment Share on other sites More sharing options...
GLO Posted October 28, 2004 Author Share Posted October 28, 2004 Defrag is a task that may require administrative credentials. If you are not logged on with an admin account it may not run as expected.FYI here is the Knowledgebase article describing the new features for SP2New features of the Scheduled Tasks Control Panel item that are included in Windows XP Service Pack 2I avoid these types of issues with XP by dual booting with 98 and using Geodisk2 for scandisk and defrag. Works like a charm with no hassle thanks again, I followed the instructions and it didnt give me any new options that werent already there. Im logged in as admin yet it wont kick off!Unfortunately i dont have a dual boot system. Link to comment Share on other sites More sharing options...
oftentired Posted October 28, 2004 Share Posted October 28, 2004 I found this interesting quote from the webpage I link at the bottom.Apparently you were on the right track with Dfrg.msc. Perhaps it requires a different implementation. Maybe create a simple batch file that has the command in it and then run the batch file as a scheduled task. I would think you can leave off the userdomain business for your local computer.Running Disk Defragmenter Requires Administrator PrivilegesAlthough any user can gain access to the Disk Defragmenter console, the ability to analyze or defragment a volume requires administrator privileges. If you do not have administrator privileges and you try to use Disk Defragmentor, you may receive the following message: Disk Defragmenter - You must have Administrator privileges to defrag a volume.Disk Defragmenter was designed primarily for stand-alone workstations or servers whose users have the ability to log on locally with administrator privileges.Disk Defragmenter is not intended to be a tool for administrators to maintain networked workstations. This version is not designed to be run remotely and cannot be scheduled to automatically defragment a volume without interactionfrom a logged-on user. The only way a non-administrator can defragment a local volume is to run the Dfrg.msc console in the context of a user who has administrator privileges. You can accomplish this by running the following command:runas /user:administrator@domain.company.com "mmc dfrg.msc"The user is prompted for the administrator password. This command may be useful for an administrator who wants to run a defragmentation on a user's computer without forcing the user to log off.http://www.kellys-korner-xp.com/xp_defrag.htm Link to comment Share on other sites More sharing options...
mow Posted October 28, 2004 Share Posted October 28, 2004 Try this linkhttp://support.microsoft.com/?kbid=814596it explains how to setup a s.task from command. Link to comment Share on other sites More sharing options...
GLO Posted October 29, 2004 Author Share Posted October 29, 2004 Try this linkhttp://support.microsoft.com/?kbid=814596it explains how to setup a s.task from command.i think doing it this way ends up the same as going thru start/programs/accessories/system tools/scheduled tasks. or the long instruction:P1. Open Control Panel2. Double-click Scheduled Tasks3. Double-click Add Scheduled Task4. On the Scheduled Task Wizard dialog, click Next5. Click Browse6. In the Select Program to Schedule dialog, navigate to the windows\system32 folder7. Select defrag.exe8. Click Open9. In the Scheduled Task Wizard dialog, type a name for the scheduled task (Disk Defragmenter, for instance)10. Under Perform this task, select how often you wish Disk Defragmenter to run11. Click Next12. Set the time at which you wish the Disk Defragmenter scheduled task to run. This should be a time when your computer is on, but not in heavy use.13. Select the frequency at which you want the Disk Defragmenter scheduled task to run (Every Day, Weekdays, or Every <N> days, where <N> is the number of days between scheduled runs)14. Click Next15. Enter a user name under which the Disk Defragmenter scheduled task will run. Note: This user must be an administrator on the local machine.16. Enter the password for the user you entered in the previous step17. Confirm the password for the user18. Click Next19. Check Open advanced properties for this task when I click Finish20. Click Finish21. In the Run text box, you should see the full path and command for defrag.exe. By default, this path is C:\WINDOWS\SYSTEM32\defrag.exe22. Append the drive letter for the drive you wish to defragment to the command in the Run text box. In a default installation, your Run command will look like this: C:\WINDOWS\SYSTEM32\defrag.exe C:23. Click OK24. In the Set Account Information dialog, enter and confirm the password for the user listed in Run as25. Click OKDisk Defragmenter will now run as the specified user on the schedule you specified when you created the scheduled task.Can you guys pls try this on your PC, try to use my steps above.Thanks 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