Solved

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

Posted on 2010-11-09
4
114 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

895 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

15 Experts available now in Live!

Get 1:1 Help Now