Solved

Syntax/Switch that will allow me to stop JKDefrag at 6AM

Posted on 2010-11-09
4
117 Views
Last Modified: 2014-11-24
I need to find out what switches need to be installed in the defrag script, or what syntax will allow me to put in a stop time.

We are currently using the program JKDefrag, the batch command is started from Windows Scheduled Task, but I've had no success finding a syntax that will allow me to put in a stop time (6AM). The code is below.

"AT 4:00 /every:su,m,t,w,th,f,s "C:\Windows\JKDefrag.exe" -example-

Edit to suit your needs

Time Format is 24 hour Military time

AT 12:00 /every:su,m,t,w,th,f,s "C:\Windows\JKDefrag.exe" (IT)

AT 18:00 /every:su,m,t,w,th,f "C:\Windows\JKDefrag.exe" (Servers)"



Any help would be appreciated.
0
Comment
Question by:SourWasabi
4 Comments
 
LVL 5

Expert Comment

by:Bidonet
ID: 34094788
I think you should use the SCHTASKS command instead.  You have the option to create and end a task.

http://ss64.com/nt/schtasks.html

0
 
LVL 26

Accepted Solution

by:
pony10us earned 250 total points
ID: 34253933
Try this:


rem Remove the "rem" in front of the version AT that you want to run. I suggest testing with
rem the first to make sure it is what you want

rem The following will kill it gracefully asking for confirmation if there are unsaved changes
rem AT 06:00 /every:su,m,t,w,th,f "taskkill /IM JKDefrag.exe"

rem The following will kill it forcefully without asking for confirmation
rem AT 06:00 /every:su,m,t,w,th,f "taskkill /F JKDefrag.exe"

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Batch File - Count Down 4 88
Internet Connection Util 8 103
Batch command to determine the Office version installed 2 223
Combine DSQuery result into loop script 6 70
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question