|
speedlever
|
 |
« on: December 20, 2009, 10:21:39 pm » |
|
MD 4.27 running on Vista Ultimate 64 bit and XP home/pro/sp.3.
In several instances, I have multiple hard disks installed per computer. I see how to initiate a manual defrag and specify each HD singly or check all HD to defrag. How do I do a scheduled task to run a script to defrag/optomize multiple HDs in one computer?
I know how to set up a scheduled task, but don't know how to tell the script which HD to perform the operation on.
|
|
|
|
|
Logged
|
|
|
|
|
jeroen
|
 |
« Reply #1 on: December 20, 2009, 10:27:01 pm » |
|
You can specify the disks on the Commandline, or you can make a script that selects the disks inside the script itself, for example with the Name volumeboolean.
|
|
|
|
|
Logged
|
|
|
|
|
speedlever
|
 |
« Reply #2 on: December 20, 2009, 10:46:53 pm » |
|
I looked at the examples under CommandLine but don't understand how to modify the scripts to do what I want. I understand what scripts do.. I just don't know enough about them to have any comfort level with what to do.
I may be better off using defraggler for my computers with multiple drives. But I'd like to understand how to modify MD to make it work like I want it to.
Thanks anyway.
|
|
|
|
« Last Edit: December 20, 2009, 10:53:36 pm by speedlever »
|
Logged
|
|
|
|
|
jeroen
|
 |
« Reply #3 on: December 21, 2009, 01:54:39 am » |
|
I may be better off using defraggler for my computers with multiple drives. But I'd like to understand how to modify MD to make it work like I want it to. Open the properties of your scheduled task and add the disks to the commandline.... it's as simple as that. If the commandline is now "c:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD" then it would become "c:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD" C: D: E: or whatever disks you want. Notice that you have to specify the disks outside the quotes.
|
|
|
|
|
Logged
|
|
|
|
|
speedlever
|
 |
« Reply #4 on: December 24, 2009, 08:21:36 am » |
|
Thanks. That seems pretty straightforward.
However, it seems to conflict with the instructions under CommandLine: The MyDefrag script interpreter ("c:\Program Files\MyDefrag v4.2.7\MyDefrag.exe") accepts the following commandline parameters. The parameters can also be used with scripts, for example "OptimizeWeekly.MyD -v C:".
The drive parameter is inside the quotes.
|
|
|
|
|
Logged
|
|
|
|
|
jeroen
|
 |
« Reply #5 on: December 24, 2009, 02:58:11 pm » |
|
However, it seems to conflict with the instructions under CommandLine: In that example the quotes are there to show which part is text and which part is commandline. The quotes are not part of the commandline.
|
|
|
|
|
Logged
|
|
|
|
|
chucko
|
 |
« Reply #6 on: January 15, 2010, 05:45:51 pm » |
|
minor thread hijack:
Running V4.27 on Server 2003.
I modified the default scheduled task as you described previously to include the drive letters of the drives that I wanted to defrag.
"c:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD" C: F:
and saved the modified task properly. This task is the only MyDefrag task that I have defined on the system.
The problem is that when the task runs it still attempts to defrag all of the drives on the system (C: D: F: Z:).
Am I doing something wrong or is this a glich in the matrix?
|
|
|
|
|
Logged
|
|
|
|
|
BloodySword
|
 |
« Reply #7 on: January 15, 2010, 05:50:15 pm » |
|
Check your VOLUMESELECT block:
VolumeSelect CommandlineVolumes() //Selects only the volumes that are in the commandline. and Mounted(yes) //Adds a condition to the volume select wich means that the volumes from the commandline MUST be mounted. VolumeActions //...
It seems that your script says "all" inside of the VolumeSelect. The commandline volumes are then ignored and all volumes on the system will be selected.
|
|
|
|
« Last Edit: January 15, 2010, 05:52:29 pm by BloodySword »
|
Logged
|
Greetings from Germany!
|
|
|
|
chucko
|
 |
« Reply #8 on: January 15, 2010, 06:08:13 pm » |
|
I was just using the default daily defrag script that comes with MyDefrag. Looking at that script, I see the following:
CommandlineVolumes() and Removable(no) and Writable(yes) and Mounted(yes)
So if I'm understanding you correctly I should change the script to this:
CommandlineVolumes(yes) and Removable(no) and Writable(yes) and Mounted(yes)
Correct?
|
|
|
|
|
Logged
|
|
|
|
|
BloodySword
|
 |
« Reply #9 on: January 15, 2010, 07:35:22 pm » |
|
Normally it should work like you combined it in the first place. Don't know why all drives are selected even if you only given two special...
|
|
|
|
|
Logged
|
Greetings from Germany!
|
|
|
|
jeroen
|
 |
« Reply #10 on: January 16, 2010, 02:57:50 am » |
|
Am I doing something wrong or is this a glich in the matrix? To determine the color of the pill you could take a look at the debug logfile. See I have a problem! for instructions.
|
|
|
|
|
Logged
|
|
|
|
|
chucko
|
 |
« Reply #11 on: January 16, 2010, 04:09:23 pm » |
|
OK, here is what I've found so far.
This is the command line from the scheduled task:
"C:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD" C: D:
and here is what the beginning of the mydefrag.debuglog file shows:
Version: MyDefrag v4.2.7 Date: 2010/01/16 01:00:00 Windows version: v5.2 build 3790 S Commandline: "C:\Program Files\MyDefrag v4.2.7\MyDefrag.exe" "C:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD" Working Directory: C:\Program Files\MyDefrag v4.2.7\Scripts Userid: administrator InstallPath = C:\Program Files\MyDefrag v4.2.7\ 01:00:00 Debug = 47 01:00:00 BatteryPower = ask 01:00:00 DiskmapFlip = ON 01:00:00 FileMoveChunkSize = 1073741824 01:00:00 OtherInstances = ask 01:00:00 PreventPowerSaving = ON 01:00:00 PreventScreenSaving = ON 01:00:00 Process priority is now NORMAL. 01:00:00 Slowdown = 100.000000 01:00:00 WhenFinished = wait 01:00:00 WindowSize = restore 01:00:00 Finished executing the script. 01:00:00 Original ScreenSaverTimeout = 1800 01:00:00 Original PowerOffTimeout = 3600 01:00:00 Running script: C:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD 01:00:00 Locating file: C:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD 01:00:00 Found: C:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD 01:00:00 Loading file into memory: C:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD 01:00:00 Converting from UTF-8 into Unicode. 01:00:00 Replacing macros. 01:00:00 Script:
It does not appear that it is picking up the two drives from the command line. All drives were in fact defragged again when this ran.
|
|
|
|
|
Logged
|
|
|
|
|
BloodySword
|
 |
« Reply #12 on: January 16, 2010, 04:39:13 pm » |
|
The VolumeSelect will be shown in the part AFTER the script was parsed, not at the beginning of the log.
|
|
|
|
|
Logged
|
Greetings from Germany!
|
|
|
|
chucko
|
 |
« Reply #13 on: January 16, 2010, 06:37:10 pm » |
|
Here is the applicable part of the log regarding volumeselect:
01:00:00 Compiling the script. 01:00:00 Executing the script. 01:00:00 WhenFinished = exit 01:00:00 Read key 'Software\MyDefrag\WindowPosition' from registry: '192 792 38 538 0 1 -1 -1 -1 -1 1024 768' 01:00:00 Starting VolumeSelect (at line 19 column 1). 01:00:00 Loading list of volumes... 01:00:00 Volume found: \\?\Volume{ca9d68a4-e812-11de-8c21-806e6f6e6963}\ 01:00:00 Volume found: \\?\Volume{ca9d68a5-e812-11de-8c21-806e6f6e6963}\ 01:00:00 Volume found: \\?\Volume{26f8d2c3-e74e-11de-add7-806e6f6e6963}\ 01:00:00 Volume found: \\?\Volume{26f8d2c2-e74e-11de-add7-806e6f6e6963}\ 01:00:00 Volume found: \\?\Volume{f2435494-e7a5-11de-addb-505054503030}\ 01:00:00 Matching volumes with drives... 01:00:00 Volume '\\?\Volume{26f8d2c2-e74e-11de-add7-806e6f6e6963}\' is mounted on 'A:\'. 01:00:00 Volume '\\?\Volume{ca9d68a4-e812-11de-8c21-806e6f6e6963}\' is mounted on 'C:\'. 01:00:00 Volume '\\?\Volume{ca9d68a5-e812-11de-8c21-806e6f6e6963}\' is mounted on 'D:\'. 01:00:00 Volume '\\?\Volume{26f8d2c3-e74e-11de-add7-806e6f6e6963}\' is mounted on 'E:\'. 01:00:00 Volume '\\?\Volume{f2435494-e7a5-11de-addb-505054503030}\' is mounted on 'G:\'. 01:00:00 Matching volumes with mountpoints... 01:00:00 Starting VolumeBoolean for 'A:' ('\\?\Volume{26f8d2c2-e74e-11de-add7-806e6f6e6963}'). 01:00:00 Volume medium is removable. 01:00:00 Finished VolumeBoolean: FALSE 01:00:00 Starting VolumeBoolean for 'C:' ('\\?\Volume{ca9d68a4-e812-11de-8c21-806e6f6e6963}'). 01:00:00 Volume medium is not removable. 01:00:00 Volume is writable. 01:00:00 Volume is mounted. 01:00:00 Finished VolumeBoolean: TRUE 01:00:00 Testing if volume 'C:\' is hybernated. 01:00:00 No, not hybernated. 01:00:00 Counting zones. 01:00:00 There are 5 zones. 01:00:00 Starting VolumeActions. 01:00:00 Processing disk C: 01:00:00 Cleaning up old data from memory. 01:00:00 Finished cleaning up old data from memory. 01:00:00 Starting to analyze volume 'C:' (\\?\Volume{ca9d68a4-e812-11de-8c21-806e6f6e6963}) 01:00:00 NTFS reserved area: from Ă806432 to 1806592 (160 clusters). 01:00:00 BytesPerSector (from IOCTL_DISK_GET_DRIVE_GEOMETRY): 512 01:00:01 This is an NTFS disk.
and the end of the log:
01:51:11 Finished VolumeSelect. 01:51:11 Finished with disk G: 01:51:11 Finished executing the script. 01:51:11 Resetting ScreenSaverTimeout to 1800 01:51:11 Resetting PowerOffTimeout to 3600
|
|
|
|
|
Logged
|
|
|
|
|
BloodySword
|
 |
« Reply #14 on: January 16, 2010, 06:40:09 pm » |
|
You cuttet the VolumeSelects for the other drives out. But I noticed, that the parameters c: and d: are ignored somehow:
"C:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD" C: D:
Version: MyDefrag v4.2.7 Date: 2010/01/16 01:00:00 Windows version: v5.2 build 3790 S Commandline: "C:\Program Files\MyDefrag v4.2.7\MyDefrag.exe" "C:\Program Files\MyDefrag v4.2.7\Scripts\OptimizeDaily.MyD"
Could it be that the sheduler did not save the additional parameters?
|
|
|
|
|
Logged
|
Greetings from Germany!
|
|
|
|