Jump to content

Recommended Posts

Posted

Hi Guys

 

Does anyone know of a way we can set our client PC;s to defrag on shutdown or at specifics times/dates? We would like to be able to do this via group policy or server end as we have about 2000 clients.

 

Thanks

Posted

defrag c: -f -v

 

We use these settings in a batch file to keep servers in check.

 

No problems in a good few years of use.

 

On he servers, we schedule it to be done at the weekend.

Posted (edited)
defrag c: -f -v

 

We use these settings in a batch file to keep servers in check.

 

No problems in a good few years of use.

 

On he servers, we schedule it to be done at the weekend.

 

Could you explain a tiny bit on how this would be set up... as in creating the batch file.

Edited by shane_saintsfc
Posted

You would just copy the code into wordpad then save the file as defrag.bat

 

In Windows 2003 Domain i cant think off the top of my head to get it on the clients as a scheduled task. In server 2008 you can set it in group policy.

Posted

or add it as a shutdown script which was what the OP asked.

 

shouldnt be a problem as long as the kids dont shutdown eavery lesson

Posted
or add it as a shutdown script which was what the OP asked.

 

shouldnt be a problem as long as the kids dont shutdown eavery lesson

 

The only problem would be if you need to reboot during a lesson or something, scheduled ask would be best

Posted
Ive been evaluating o&o defrag on my machine. Purports to do on the fly defragmenting, and also a scheduled startup defrag etc. Not sure if its something worth getting for every workstation right enough.
Posted

Big fan of JKDefrag myself. (Can be found on filehippo if you search)

 

Can be set to run via batch. Seems to do a far better defrag than the windows system defrag. Has plenty of flags to play with too.

 

Can also be set to run as the screensaver, though whether you would want such heavy disc activity so frequently is questionable.

  • Thanks 1
Posted

Sorry for the delay, on the road this morning.

 

Create a batch file with the following in: -

 

c:\windows\system32\defrag.exe c: -f -v

 

shutdown -s

 

 

 

The batch file can be local, but restrict access to it so little people do not play.

 

Schedule the batch file to run, using an administrator's credentials, on the evening in question.

 

The script will defragment the c: the -f forces it to do so even if it is short of space and -v means verbos (no user input required).

 

Once defrag has completed, the PC will shut down.

 

If you decide to test the script, you can cancel the defrag process by pressing +C to cancel the batch task.

  • Thanks 1
Posted (edited)
Sorry for the delay, on the road this morning.

 

Create a batch file with the following in: -

 

c:\windows\system32\defrag.exe c: -f -v

 

shutdown -s

 

 

 

The batch file can be local, but restrict access to it so little people do not play.

 

Schedule the batch file to run, using an administrator's credentials, on the evening in question.

 

The script will defragment the c: the -f forces it to do so even if it is short of space and -v means verbos (no user input required).

 

Once defrag has completed, the PC will shut down.

 

If you decide to test the script, you can cancel the defrag process by pressing +C to cancel the batch task.

 

 

Thanks :) Can this still run if the PC in logged off ie (On CTRL AlT DEL) Screen. Also is there a script to run that will run the defrag when a user click shutdown. We are looking at doing this monthly so when a user shutdown it will run the defrag before.

 

Thanks

Edited by shane_saintsfc
Posted
Thanks :) Can this still run if the PC in logged off ie (On CTRL AlT DEL) Screen. Also is there a script to run that will run the defrag when a user click shutdown. We are looking at doing this monthly so when a user shutdown it will run the defrag before.

 

Thanks

 

Not so sure about getting it to run when you click on shutdown, but it's easy enough to create a shortcut to the batch file and save it in your start menu. I give it the same icon as shutdown. Might be worth telling it to run a disc cleanup before it runs a defrag too. Just add 'cleanmgr' to the batch file.

Posted
If you set it as the shutdown script in AD then it will run on shutdown no matter where you shut it down from. You could use some conditionals in the file to check to see if it is the 28th of the month and only run if it is that day which would give you the once a month thing.
  • Thanks 1
Posted
If you set it as the shutdown script in AD then it will run on shutdown no matter where you shut it down from. You could use some conditionals in the file to check to see if it is the 28th of the month and only run if it is that day which would give you the once a month thing.

 

Now that's an idea.

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



×
×
  • Create New...