powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Windows [игнор отключен] [закрыт для гостей] / как запустить из bat-файла задание из Scheduled Tasks?
5 сообщений из 5, страница 1 из 1
как запустить из bat-файла задание из Scheduled Tasks?
    #33900316
ednet
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Подскажите пожалуйста,
Как запустить из командной строки уже созданное задание из Scheduled Tasks?
...
Рейтинг: 0 / 0
как запустить из bat-файла задание из Scheduled Tasks?
    #33900374
GeT
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
запускать из командной строки по расписанию at /?
...
Рейтинг: 0 / 0
как запустить из bat-файла задание из Scheduled Tasks?
    #33900478
ednet
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
GeTзапускать из командной строки по расписанию at /?


Нет, я имею ввиду, что мне необходимо запустить уже существующую задачу созданную не командой at , а утилитой Scheduled Tasks. Ее задания хранятся в Windows\Tasks\*.job. .Если просто запустиь *.job, то ситема просит указать программу в которой будет запущено это задание.
...
Рейтинг: 0 / 0
как запустить из bat-файла задание из Scheduled Tasks?
    #33900530
Фотография rrrrrrrrrr
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Windows Helpschtasks run

Starts a scheduled task immediately. The run operation ignores the schedule, but uses the program file location, user account, and password saved in the task to run the task immediately.

Syntax
schtasks /run /tn TaskName [/s Computer [/u [Domain\]User [/p Password]]]

Parameters
/tn TaskName
Required. Identifies the task.
/s Computer
Specifies the name or IP address of a remote computer (with or without backslashes). The default is the local computer.
/u [Domain\]User
Runs this command with the permissions of the specified user account. By default, the command runs with the permissions of the current user of the local computer.
The specified user account must be a member of the Administrators group on the remote computer. The /u and /p parameters are valid only when you use /s.

/p Password
Specifies the password of the user account specified in the /u parameter. If you use the /u parameter, but omit the /p parameter or the password argument, Schtasks prompts you for a password.
The /u and /p parameters are valid only when you use /s.

/?
Displays help at the command prompt.
Remarks
Use this operation to test your tasks. If a task does not run, check the Task Scheduler Service transaction log, Systemroot\SchedLgU.txt, for errors.
Running a task does not affect the task schedule and does not change the next run time scheduled for the task.
To run a task remotely, the task must be scheduled on the remote computer. When you run it, the task runs only on the remote computer. To verify that a task is running on a remote computer, use Task Manager or the Task Scheduler transaction log, Systemroot\SchedLgU.txt.
Examples
To run a task on the local computer
The following command starts the "Security Script" task.

schtasks /run /tn "Security Script"

In response, SchTasks.exe starts the script associated with the task and displays the following message:

SUCCESS: Attempted to run the scheduled task "Security Script".
As the message implies, Schtasks tries to start the program, but it cannot very that the program actually started.

To run a task on a remote computer
The following command starts the Update task on a remote computer, Svr01:

schtasks /run /tn Update /s Svr01

In this case, SchTasks.exe displays the following error message:

ERROR: Unable to run the scheduled task "Update".
To find the cause of the error, look in the Scheduled Tasks transaction log, C:\Windows\SchedLgU.txt on Svr01. In this case, the following entry appears in the log:


"Update.job" (update.exe) 3/26/2001 1:15:46 PM ** ERROR **
The attempt to log on to the account associated with the task failed, therefore, the task did not run.
The specific error is:
0x8007052e: Logon failure: unknown user name or bad password.
Verify that the task's Run-as name and password are valid and try again.

Apparently, the user name or password in the task is not valid on the system. The following schtasks /change command updates the user name and password for the Update task on Svr01:

schtasks /change /tn Update /s Svr01 /ru Administrator /rp PassW@rd3

After the change command completes, the run command is repeated. This time, the Update.exe program starts and SchTasks.exe displays the following message:

SUCCESS: Attempted to run the scheduled task "Update".
As the message implies, Schtasks tries to start the program, but it cannot very that the program actually started.

schtasks end

Stops a program started by a task.

Syntax
schtasks /end /tn TaskName [/s Computer [/u [Domain\]User [/p Password]]]

Parameters
/tn TaskName
Required. Identifies the task that started the program.
/s Computer
Specifies the name or IP address of a remote computer. The default is the local computer.
/u [Domain\]User
Runs this command with the permissions of the specified user account. By default, the command runs with the permissions of the current user of the local computer.
The specified user account must be a member of the Administrators group on the remote computer. The /u and /p parameters are valid only when you use /s.

/p Password
Specifies the password of the user account specified in the /u parameter. If you use the /u parameter, but omit the /p parameter or the password argument, Schtasks prompts you for a password.
The /u and /p parameters are valid only when you use /s.

/?
Displays help.
Remarks
SchTasks.exe ends only the instances of a program started by a scheduled task. To stop other processes, use TaskKill, a tool included in Windows XP Professional. For more information about TaskKill, see Taskkill.
Examples
To end a task on a local computer
The following command stops the instance of Notepad.exe that was started by the My Notepad task:

schtasks /end /tn "My Notepad"

In response, SchTasks.exe stops the instance of Notepad.exe that the task started, and it displays the following success message:

SUCCESS: The scheduled task "My Notepad" has been terminated successfully.
To end a task on a remote computer
The following command stops the instance of Internet Explorer that was started by the InternetOn task on the remote computer, Svr01:

schtasks /end /tn InternetOn /s Svr01

In response, SchTasks.exe stops the instance of Internet Explorer that the task started, and it displays the following success message:

SUCCESS: The scheduled task "InternetOn" has been terminated successfully.
...
Рейтинг: 0 / 0
как запустить из bat-файла задание из Scheduled Tasks?
    #33900614
ednet
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Спасибо!!! Все заработало.
...
Рейтинг: 0 / 0
5 сообщений из 5, страница 1 из 1
Форумы / Windows [игнор отключен] [закрыт для гостей] / как запустить из bat-файла задание из Scheduled Tasks?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]