Here is my solution for a task scheduling without using Windows task scheduler:
@echo off
rem Get local date and time in a region independent format.
for /F "tokens=2 delims==." %%I in ('%SystemRoot%\System32\wbem\wmic.exe OS GET LocalDateTime /VALUE') do set "LocalDateTime=%%I"
rem Is the day in month 01 to 14, remove the system attribute from
rem batch file and exit the batch file execution as nothing to do.
rem This is a string comparison and not an integer comparison.
if "%LocalDateTime:~6,2%" LSS "15" %SystemRoot%\System32\attrib.exe -s "%~f0" & goto :EOF
rem Get attributes of the batch file.
set "BatchAttributes=%~a0"
rem Is the system attribute set, do nothing and exit the batch file.
if "%BatchAttributes:~4,1%" NEQ "-" goto :EOF
rem Set system attribute on the batch file.
%SystemRoot%\System32\attrib.exe +s "%~f0"
rem Add here the commands to execute once in month on 15th or any later day.
echo Run the application ...
This batch file is written to run the command lines at bottom on 15th day in month exactly one times. But in case of the batch file is not started on 15th day (Sunday, vacation, ...), the commands at bottom are executed on next day in second half of month on which the batch file is executed manually or on startup of Windows.
For understanding the used commands and how they work, open a command prompt window, execute there the following commands, and read entirely all help pages displayed for each command very carefully.
attrib /?
call /?
... explains %~a0
(batch file attributes) and %~f0
(batch file name with extension and full path).
echo /?
for /?
goto /?
if /?
rem /?
set /?
wmic /?
wmic os /?
wmic os get /?
wmic os get localdatetime /?
And read also Single line with multiple commands using Windows batch file.