Jump to content

scheduled tasks- defrag


GLO

Recommended Posts

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


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

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 SP2

New features of the Scheduled Tasks Control Panel item that are included in Windows XP Service Pack 2

I 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 :D

Link to comment
Share on other sites

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 SP2

New features of the Scheduled Tasks Control Panel item that are included in Windows XP Service Pack 2

I 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 :D

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

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 Privileges

Although 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 interaction

from 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

Try this link

http://support.microsoft.com/?kbid=814596

it 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:P

1. Open Control Panel

2. Double-click Scheduled Tasks

3. Double-click Add Scheduled Task

4. On the Scheduled Task Wizard dialog, click Next

5. Click Browse

6. In the Select Program to Schedule dialog, navigate to the windows\system32 folder

7. Select defrag.exe

8. Click Open

9. 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 run

11. Click Next

12. 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 Next

15. 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 step

17. Confirm the password for the user

18. Click Next

19. Check Open advanced properties for this task when I click Finish

20. Click Finish

21. 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.exe

22. 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 OK

24. In the Set Account Information dialog, enter and confirm the password for the user listed in Run as

25. Click OK

Disk 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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