Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automating the defrag process
#1

Today I decided to use that defrag.vbs in my last tip to defrag the computers on my lan at the stroke of midnight each month.

Here is how to do it using simple batch scripting. There could be a simpler way but I just put this together and copy and pasted a few lines and boom I was done and never had to leave my seat.

 

[ADDDEFRAG.BAT]

 

mkdir \\computer\c$\scripts

copy C:\apps\scripts\defrag.vbs \\computer\c$\scripts\

AT \\computer 00:00 /INTERACTIVE /EVERY:1 c:\scripts\defrag.vbs

 

The first line makes a directory on the users computer called scripts.

The next line copies the defrag.vbs from my computer to the users newly created script folder.

The last line makes use of the AT command to schedule the defrag to run at midnight monthly.

 

In the batch file I just copied the 3 lines over and over until I had added all the computers I needed and edited the lines. Then I sat and executed it with a smile, watching it do all the work.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)