Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
June 18, 2013, 10:58:18 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: help with OptimizeMonthly.MyD and shutdown script  (Read 2718 times)
fragmented
Newbie
*
Posts: 4


View Profile
« on: July 20, 2010, 02:03:56 pm »

Hi All

I am trying to write a script for my desktop that will start the OptimizeMonthly.MyD from the MyDefrag Scripts folder and when completed, shut the PC down.

I do not want to change the original OptimizeMonthly.MyD or the Settings.MyD that MyDefrag installs as program updates will over-write these and I would then have to change again.

The script I have been trying, defrags C: drive  Grin but once done will not automatically exit Mydefrag and run the shutdown routine.  Sad 
As soon as I manually exit MyDefrag the shutdown routine runs and shuts down the PC.
I have done lots of Googling and experimentation but can not get it to work fully  Huh, hence my request for guideance here.

This is the base script i have been experimenting with.

ECHO PERFORMING DEFRAG...
cd "C:\Programs-Utilities & Tools\MyDefrag\Scripts\"
start /wait OptimizeMonthly.MyD C:

/* Automatically exit MyDefrag when it is finished. */
WhenFinished(shutdown)

start %systemroot%\system32\SHUTDOWN.exe -s -f -t 30

EXIT

Happy and appreciative if someone wants to fix my script or write one that works.

Thanks in anticipation.
Logged
Kasuha
JkDefrag Hero
*****
Posts: 595


View Profile
« Reply #1 on: July 20, 2010, 03:29:51 pm »

WhenFinished(shutdown) is a MyDefrag script command, not windows batch interpreter command.
I believe your best bet is to make a copy of whatever MyDefrag script you want use for the optimization and insert this command at an appropriate place to it, then run the optimization using this new script.

Please note that current version of MyDefrag does not contain OptimizeMonthly.MyD script - there are specialized versions of this script instead. Therefore I'd also suggest you to upgrade to most recent version of MyDefrag.
Logged
Darlis
JkDefrag Hero
*****
Posts: 1725


View Profile WWW
« Reply #2 on: July 20, 2010, 05:52:55 pm »

If you upgrade to the latest MyDefrag version, you'll get an AutomaticMonthly script which automatically exits on completion without having to edit it.

If you remove "WhenFinished(Shutdown)" from your batch script and change the script name, then it'll work,
Logged

Need help creating a script? Try MyDefrag Script Creator.
fragmented
Newbie
*
Posts: 4


View Profile
« Reply #3 on: July 31, 2010, 07:16:36 am »

Thanks for the replies

I was using v4.3.1 but it kept crashing part was through a defrag (I am using Windows 7)
Had to go back to v4.2.9 to sort the problem.
As such, I can not use the AutomaticMonthly script which automatically exits on completion.

Following Kasuha's input, I created (copied) another OptimizeMonthly.MyD script and tweaked it and now it defrags and then shuts down.

Ultimately, I want a batch file that points to a MyDefrag script so that when the program updates, no tweaking of the batch file is required.

Will try the next version of MyDefrag and see if the crashing problem goes away and if so use the AutomaticMonthly script (assuming it remains a script as they seem to change regularly))

It's a pity MyDefrag will not do a boot defrag to sort out the system files. 
As it is, I have to use another defrag program to do a boot defrag.
Both are excellent programs, but simply using one would be better and I prefer that program was MyDefrag.

cheers
Logged
Darlis
JkDefrag Hero
*****
Posts: 1725


View Profile WWW
« Reply #4 on: July 31, 2010, 09:30:01 am »

If the new version keeps crashing (in zone 4?) you've probably ran into the "program hints" crash. Look here for a solution.
Logged

Need help creating a script? Try MyDefrag Script Creator.
fragmented
Newbie
*
Posts: 4


View Profile
« Reply #5 on: August 04, 2010, 02:17:45 pm »

Hi Darlis

I do not know where in the defrag the program would crash.
Likely zone 4 or 5 based on the time it ran before crashing.

I looked at the Prefetch folder and the only files there were Layout.ini and the ReadyBoot (folder).
No pf files.
Take this to mean Prefetch was not working.

I recall using a program a long time ago for fixing Prefetch.
I found it again amongst my files and updated it (http://exilesofthardware.blogspot.com/2009/09/tweakprefetch.html) and ran it.
Tried to incude an image of the program but can not get it to show?

Following a reboot I had some pf files in the folder.

Installed MyDefrag 4.3.1
Doctored my batch script as you suggested earlier.
Ran my script and it defraged C drive and shutdown.

Without my shutdown command, the AutomaticMonthly.MyD script wants to defrag all my drives which i do not want.

Thanks for your interest and input.
Much appreciated.
Logged
Darlis
JkDefrag Hero
*****
Posts: 1725


View Profile WWW
« Reply #6 on: August 04, 2010, 02:51:22 pm »

Without my shutdown command, the AutomaticMonthly.MyD script wants to defrag all my drives which i do not want.
The AutomaticMonthly scripts ignores the parameters and tries to process all volumes. What did you do to let it only process C:?
Logged

Need help creating a script? Try MyDefrag Script Creator.
fragmented
Newbie
*
Posts: 4


View Profile
« Reply #7 on: August 07, 2010, 12:20:08 am »

Darlis

I used the following script:

ECHO PERFORMING DEFRAG...
cd "C:\Programs-Utilities & Tools\MyDefrag v4.3.1\Scripts\"
start /wait AutomaticMonthly.MyD C:

start %systemroot%\system32\SHUTDOWN.exe -s -f -t 30

EXIT

I was surprised the AutomaticMonthly.MyD did shutdown once C drive only had been defragmented since the MyDefrag script says do all drives.

I updated MyDefrag on a laptop and ran the script.
MyDefrag crashed in zone 5.
Used TweakPrefetch again.
Ran the script and following a full defrag of C drive (only) the laptop shutdown.
Pretty sure MyDefrag closed before shutdown.

Anyway, right or wrong, at this time it appears I have achieved my objective.

cheers
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!