How to run a batch file on a schedule - batch-file

I want to make a batch file load fortnightly on a Friday at 9.00am. I would like to do it without task scheduler if possible.

Use Windows' built-in at command. Documentation here.
Or the newer schtasks and using a RunInterval (RI) of 20160 minutes. Documentation here.

Related

Creating a scheduled task for different users and battery mode off

I've a python executable file that I've written. I would like to distribute it to other people. The exe will be on the fileserver and this exe file should work on 14:00 for all the users.
Firstly, I tried to put it into a batch file with the cmd code to create a scheduled task and -schtask command-. The code is getting the directory into a variable and adding /program.exe and sending it to schtask command.
Problem is I can not set the option for working on battery mode in task scheduler with cmd.
Is there an alternative to CMD? As I understand, I can use powershell, but not sure how?
Thanks in advance.

I want to schedule a batch file without Windows Task Scheduler

I have to login into SAPBW application via SAPGUI but at specific times and I want that to happen without Windows Task Scheduler. If it's possible to code something within the bat file, then please suggest something. Open to other suggestions as well.
I don't know why you don't want to use task scheduler (since it is the easiest way to schedule your batch file) but you will need at least a 3rd party software as a scheduler and task scheduler happens to be the most convenient one. If it's the case that you don't want any 3rd party software I've seen it once where someone put the batch file in the HKEY_LOCAL_MACHINE with the files that are executed on start. So he just restarted hes server every day and then the batch file was executed on start, but you will need to be creative to find good ways around 3rd party software.

Scheduled Task won't work properly for any scheduled task involving a JAR file

Is there any fix to this? So far I've resorted to using a software called "System Scheduler", but I really want to know if I can manage to make it work with Windows' built in Scheduled Task.
.bat:
start /D C:\Jars\Load\ /B LoadInc.jar
I also tried:
"C:\Program Files\Java\jdk1.6.0_19\bin\java.exe" -jar
"C:\Jars\Load\LoadInc.jar"
As for the Task Scheduler, its only function is running the .bat at a specific time. I've tried it of course using "Run now".
I noticed it opens the "javaw" process for like 5 seconds (Meaning it does nothing). But if I go and double click the .bat, it works with no issues and takes like 5 minutes to do the process (Of course, with the process "javaw" open 'til the end").

Does anyone know of a way to turn off Windows Defragmenter's default schedule using a batch file?

I would like to use a batch file to stop Windows Disk Defragmenter from running on a schedule. By default it is enabled and I would like to disable it on Windows 7
Right now it is turned off but you get the idea.
Does anyone know how to do this?
I have look at the command line tools for defrag.
http://www.howtogeek.com/howto/37889/dig-deeper-in-windows-defrag-via-command-prompt/
But there doesn't seem to be a option to turn it off.
Why I'm asking is because I have a large number of computer that are running ssd's. Do to there locations it would take quite a while to walk to every computer and check to make sure defrag is disabled. I can push a batch file to run on these computers easily so I am trying to find a way to disable the scheduler using the command line.
I found out that it is impossible to disable the defrag schedule using the command line for defrag.exe but you can just disable it using task scheduler. (Thanks Stephan)
schtasks /Change /TN \Microsoft\Windows\Defrag\ScheduledDefrag /DISABLE
This does have to run at elevated privileges.

A scheduled batch with java program

Good day,
I have written a java code which pulls Active Directory user details.
However I need to schedule this program to run daily with a batch script possibly.
I do not know how to perform this.
Thanks,
Patrick
I think you are looking for the crontab command: http://en.wikipedia.org/wiki/Cron. It's not the easiest syntax to work with but it will run a command with a defined frequency...

Resources