Intro Download and install Frequently Asked Questions Tips and tricks

Homepage







© J.C. Kessels 2009
MyDefrag Forum
June 19, 2013, 12:46:27 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Using Batch Files  (Read 4281 times)
Miykel
JkDefrag Junior
**
Posts: 6


View Profile
« on: April 26, 2010, 03:33:11 am »

G'Day,  I hope someone will be able to help;
          I've just started to learn to write batch files, and like any new toy I want to play with it, anyhow, I'm trying to write a batch file to start, run, defrag muliple drives and shut down PC., with My Defrag, BUT, I can get the app. to open with correct drives selected but I still have to push the "run" button, damn, ignorence is not always bliss.
    Any help would be greatly appreciated
Kind regards Miykel  Roll Eyes Undecided
Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #1 on: April 26, 2010, 03:42:01 am »

If you run a specific script you don't need to press run, read more here under commandline
Code:
OptimizeWeekly.MyD C: D:

jonib
Logged

Miykel
JkDefrag Junior
**
Posts: 6


View Profile
« Reply #2 on: April 26, 2010, 04:51:44 am »

Thank you Jonib for your reply;

     I've read and read the tutorials till I'm crosseyed, plus I don't necessarily want to set any form of automatic schedule, it's mainly about writting the batch file to run the program, I'm using MyDefrag as a guinea pig, so to speak, I'm probably about 10 years behind you guys so I'm on a vertical learning curve.
    It doesn't seem to matter what I do. either batch file or Command line, I can get the program to open and select the correct drives but it will not run (blast), this is what I've entered;
   
     "C:\program files\MyDefrag v4.2.9\MyDefrag.exe" C:, D:, F:.
 Regards Miykel    Tongue Huh
Logged
jonib
JkDefrag Hero
*****
Posts: 810


View Profile
« Reply #3 on: April 26, 2010, 04:57:47 am »

Like I said you need to specify a script so you don't need to press run.
Code:
"C:\program files\MyDefrag v4.2.9\MyDefrag.exe" -r OptimizeWeekly.MyD -v C: -v D: -v F:

jonib
Logged

Miykel
JkDefrag Junior
**
Posts: 6


View Profile
« Reply #4 on: April 26, 2010, 10:17:41 am »

Thanks again Jonib;
                           That fixed it, slowly starting to get my brain around this whole script deal, it's rather difficult when your nearly 60 y.o. and living in the middle of nowhere.
  Thanks again for your patients;
 Kind Regards Miykel
Logged
Darlis
JkDefrag Hero
*****
Posts: 1725


View Profile WWW
« Reply #5 on: April 26, 2010, 11:58:42 am »

If you have associated .MyD files with MyDefrag.exe (usually done during installation) you don't have to call MyDefrag.exe explicitly. See Jonib's first post. This way you don't have to change your batch files when you install an new MyDefrag version.
Logged

Need help creating a script? Try MyDefrag Script Creator.
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #6 on: April 26, 2010, 02:59:55 pm »

Tip: see the MyDefrag WhenFinished script setting to shutdown the PC when a script has finished.
Logged
Miykel
JkDefrag Junior
**
Posts: 6


View Profile
« Reply #7 on: April 27, 2010, 03:59:07 am »

G'Day and many thanks for your help   Grin Cheesy
  I'll see how I go with the "exit" & "shut down" commands tonight,
  One question though, is it necessary to include  *  in the string (?)(terminology is all new to)
  Regards Miykel  Roll Eyes
Logged
Darlis
JkDefrag Hero
*****
Posts: 1725


View Profile WWW
« Reply #8 on: April 27, 2010, 08:57:16 am »

  One question though, is it necessary to include  *  in the string (?)(terminology is all new to)
Which string?
Logged

Need help creating a script? Try MyDefrag Script Creator.
Miykel
JkDefrag Junior
**
Posts: 6


View Profile
« Reply #9 on: April 28, 2010, 10:28:18 am »

G'Day again,  Smiley
       Firstly; Darlis, as I said this is all new to me, which is why I'm interested, so I guess I got the terminology wrong (damn, I'll get it yet) what I was "trying" to ask was when I write the command do I include the  *  or not Huh,
       Next thing is I am able to get it to open and defrag as many drives as I want, BUT ,I can't get it to exit or shut down the PC.
       I tried  Mydefrag.exe" /when finished(shut down)
                           ""     ""  /shut down
"C:\program files\mydefrag v4.2.9\mydefrag.exe" -r OptimizeWeekly.MyD -v G: /Automatically exit MyDefrag when it is finished. /WhenFinished(exit)
Please don't laugh just help please
Regards  Miykel
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #10 on: April 28, 2010, 11:44:47 am »

when I write the command do I include the  *  or not ?
What command? Write it where?

Quote
I tried  Mydefrag.exe" /when finished(shut down)
The WhenFinished() script setting has to be put inside a MyDefrag script. It is not a commandline parameter and you cannot use it on the command line.
Logged
Darlis
JkDefrag Hero
*****
Posts: 1725


View Profile WWW
« Reply #11 on: April 28, 2010, 11:53:44 am »

Everything between /* and */ is a comment and thus ignored by MyDefrag. But this works only inside scripts, not as command line parameters. You can see the available command line parameters here: http://www.mydefrag.com/Manual-Scripts.html#Commandline

When using batch files, you can also use "shutdown -s -t 0" as your last command. This will shut down Windows.
« Last Edit: April 28, 2010, 11:55:18 am by Darlis » Logged

Need help creating a script? Try MyDefrag Script Creator.
Miykel
JkDefrag Junior
**
Posts: 6


View Profile
« Reply #12 on: April 30, 2010, 01:38:43 pm »

G'Day;  Smiley
  Well thanks so much for all your help and patients, I'm afraid I just don't know enough about writing scripts yet to do any good, I can still only get MyD to open and defrag any or all drives but not exit or shut down, my biggest hurdle is the terminolgy, for instance: when you said "this only works inside scripts" I have absolutely no idea what that means or how to do it, whatever "it" is, so I'll have to do some more study and try to get my head around the terminology.
Thank you all once again, much appreciated.
Kind regards Miykel   Smiley Cry
Logged
jeroen
Administrator
JkDefrag Hero
*****
Posts: 7156



View Profile WWW
« Reply #13 on: April 30, 2010, 05:23:39 pm »

I have absolutely no idea what that means
For more information see the Scripts chapter.
Logged
keanrose
Newbie
*
Posts: 2


View Profile
« Reply #14 on: August 25, 2010, 05:24:13 am »

I have absolutely no idea what that means
For more information see the Scripts chapter.

yes... Thank you so much for this.

virtual assistant
Logged
Pages: [1] 2
  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!