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.

Automatic DEFRAG once a month?

Featured Replies

I would like to run a DEFRAG once a month on computers in an OU, is there an easy way to get this done? It would be at a time where nobody is around; I think it would then need to run as an elevated user.

Any ideas would help


  • Author

I am aware of scheduled tasks =)...

What I am not aware of is adding scheduled tasks to computers across a network (active directory)

Add the task via a gpo which will run a batch. This batch will use the at command to add the task on each computer.

  • 2 months later...
Add the task via a gpo which will run a batch. This batch will use the at command to add the task on each computer.

I was wondering if someone could please explain further... :huh:

If you install O&O Defrag(not sure where to get it right now) it has an automatic defrag of volumes.

Basically create a new gpo, in machine configuration, windows parameters, scripts, startup, and it's there that you'll put the batch script.

This batch script must create the scripts needed to run the defrag and then add the task with the at command for example.

Example for batchs that will create a batch file and then add the scheduled task:

echo defrag c: /f >%systemroot%\autodefragc.cmd
at 01:00 /every:01 %systemroot%\autodefragc.cmd

This should work. Anyway i've never tried this, but this is the way i'll do things.

Basically create a new gpo, in machine configuration, windows parameters, scripts, startup, and it's there that you'll put the batch script.

This batch script must create the scripts needed to run the defrag and then add the task with the at command for example.

Example for batchs that will create a batch file and then add the scheduled task:

echo defrag c: /f >%systemroot%\autodefragc.cmd
at 01:00 /every:01 %systemroot%\autodefragc.cmd

This should work. Anyway i've never tried this, but this is the way i'll do things.

OK. I kinda get the idea. I've attached a screen shot from an XP virtual machine (I will really be using it for Win2k server). Am I going in the right direction?

Thanks

post-29225-1156366741_thumb.jpg

You do not need to create autodefragc.cmd it will be created by script.cmd on each computer. Other than that, it should work.

You do not need to create autodefragc.cmd it will be created by script.cmd on each computer. Other than that, it should work.

OK. I've done what you've said, and I've attached a picture of what I've got. I set it on my Win2000 Active Directory Server. I set the script in "gpedit.msc > Local Computer Policy > Computer Configuration > Windows Settings > Scripts (Startup/Shutdown)"

But it doesn't go out to the whole network.

There is a command to define a single remote computer...

\\computername	 Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.

So... The AT command is only setting the script to run on the local computer. I would like to schedule this for every computer in our network:

at 1:30 /every:Su %systemroot%\autodefragc.cmd

:)

post-29225-1157054394_thumb.jpg

Edited by 1boredguy

Since this is a log-on/log-off type of script, dozens of scheduled tasks will be created each week on each workstation. Will multiple+identical scheduled tasks cause any problems??

Thanks

  • 5 weeks later...

Im a bit lost here but where did autodefragc.cmd come from or what is it doing?

thx

P.S in answer to your question i dont think you will have a huge problem adding many task to log on/off. Only thing im aware it may slow down there log on/off depending on the tasks at hand

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.