jeudi 18 février 2016

How to execute a chunk of code on a specific date in a .bat file?

I'm looking to have a .bat file run at startup to check if the date it September 18th, which is my birthday. What I have written is @echo off if %date% == Sun 09/18/2016 start /d C:\Users\david\Documents\birthday.bat end if but that doesn't work. I'm fairly new to scripting, so any help would be appreciated.

EDIT: I also tried using Schtasks to create a scheduled task that executes birthday.bat on the given date, but that failed entirely to create a task. I am running Win10 and want to do this entirely from a .bat file.

Aucun commentaire:

Enregistrer un commentaire