Solved

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

Posted on 2010-11-09
4
112 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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now