Create a scheduled task on Windows XP 32-bit

Asked

Viewed 355 times

2

I want to create or modify a task per command line, that on the same machine. I’m using the command Schtasks with argument /Create.

But I only got on Windows 8, when I took the BAT to the machine Windows XP (32-Bit) didn’t work.

schtasks /Create /TN "MyTask" /TR C:\MyTask.bat /SC Daily /ST 07:00:00

Returns the message:

ERRO: Sintaxe inválida

But it doesn’t specify which.

I did not find way to do with VBS, I searched in several topics of other countries, but nothing, I believe it is the version of Windows.

1 answer

1


It’s really not possible to create (and recreate) tasks per command line in Windows XP.

The solution I came up with was to create in a single task several triggers which is very annoying, so I would prefer a BAT to do it.

I activated the checkbox option Show multiple schedules:

inserir a descrição da imagem aqui

So I could have access to the 'New' button where includes a trigger with repeater identical to the previous one, but with an hour more:

inserir a descrição da imagem aqui

When I created one for each time (standard 24 hours), from 00:00 until 23:00

So when the system starts (remembering that all triggers start without user authentication, that is only after LOGON).

To complete I copied the file *.JOB from the TASKS folder to my application folder.

copy %windir%\tasks\mystask.job %homedrive%\myapp\

As even to stop ('/end') or delete ('/delete') keep giving errors I created in the menu of my application a method to "TURN ON" and "OFF" the schedule.

@ECHO OFF
:STARTAPP
IF EXIST %windir%\tasks\mystask.job (
SET ABKP=ON
) ELSE (
SET ABKP=OFF
)
CLS
ECHO [1] Menu 1
ECHO [2] Menu 2
ECHO [3] Ativar ou desativar AUTOBACKUP: %ABKP%
ECHO [4] Menu 4
ECHO.
SET /P SLT= Selecione um dos itens acima: 
IF "%SLT%"=="1" (GOTO OPTION1)
IF "%SLT%"=="2" (GOTO OPTION2)
IF "%SLT%"=="3" (GOTO OPTION3)
IF "%SLT%"=="4" (GOTO OPTION2)

:OPTION3
IF EXIST %windir%\tasks\mystask.job (
COPY %HOMEDRIVE%\myapp\mytask.job %windir%\tasks\
) ELSE (
DEL %windir%\tasks\mystask.job
)
GOTO STARTAPP

And the best, how it works only after the user "logged in" then independent of the machine I put or user that is running when the file *.JOB is copied to folder TASKS and you check the properties it automatically changes the user to whatever is running, ensuring that it will work since it does not request authentication.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.