Command line tool
Advanced Task Scheduler comes with a command line task execution tool. You can create tasks in the "Shortcut properties" window as well as use this tool.
The command line tool is located in the Advanced Task Scheduler installation folder and is named advscheduler_commander.exe, advscheduler_procmd.exe (Professional Edition) or advscheduler_netcmd.exe (Network Edition). It is recommended to run the command line tool from this folder only (do not copy it to other folders).
Command line
[--Execute [-lang langid] [-type [logstdout | processuser | currentuser | localsystem | logonuser [-username user_name] [-password password] | passwordless [-username user_name]] [-stdin stdin] [-exefile exe_file] [-cmdline cmd_line] [-cmdshow [hidden | normal | maximized | minimized | normalnoactive | minimizednoactive]] [-startin path] [-terminate sec] [-desktop desktop_name]]
[--Message [-lang langid] [-type [ask | popup | layered | balloon | toast | default]] [-title title] [-text message] [-timer seconds] [-buttons [ok | okcancel | yesno | yesnocancel]] [-snd sound_file] [-bg background_image_file]]
[--Service [-lang langid] [-type [start | stop | pause | continue | check]] [-name name] [-startargs startargs]]
[--KillProcess [-lang langid] [-user user_name] [-image image_file] [-anyway] [-restore] [-list]]
[--KillWindow [-lang langid] [-user user_name] [-caption window_caption] [-begins] [-ends] [-contains] [-anyway] [-restore] [-list]]
[--RasDial [-lang langid] [-name entry_name] [-auth username password] [-authbase64 username_password] [-attempts number_of_attempts]]
[--RasHangUp [-lang langid] [-name entry_name] [-allnames]]
[--PlaySound [-lang langid] [-device device_name] [-sound sound_file]]
[--TurnOff [-lang langid] [-type [turnoff | standby | hibernate | reboot | logoff | monitor]] [-logoff [user_name]]]
[--SendMessage [-lang langid] [-computer computer_name] [-msg message]]
[--SendEMail [-lang langid] [-email email_address] [-server server[:port]] [-secure [starttls|smtps]] [-auth username password] [-authbase64 username_password] [-sender sender_address] [-subject subject] [-msg message] [-attach attach_file] [-attachmsg message]]
[--SendKeys [-lang langid] [-caption window_caption] [-begins] [-ends] [-contains] [-sequence sequence]]
[--HTTP [-lang langid] [-url url] [-file file_name] [-overwrite] [-head] [-auth username password] [-authbase64 username_password] [-post post_data] [-timeout sec] [-proxy server[:port]] [-proxytype [HTTP | SOCKS5]] [-proxyauth username password] [-proxyauthbase64 username_password] [-useragent useragent] [-certauth [-certfile file] [-certpasswd password]]]
[--FTP [-lang langid] [-upload | -download | -delete | -uploadfile | -downloadfile | -deletefile] [-remote remote_path] [-local local_path] [-include file_masks] [-exclude file_masks] [-overwrite] [-purgefile] [-passive] [-forceutf8] [-usessl] [-timeout sec] [-auth username password] [-authbase64 username_password] [-proxytunnel server[:port]] [-proxytype [HTTP | SOCKS5]] [-proxyauth username password] [-proxyauthbase64 username_password] [-certauth [-certfile file] [-certpasswd password]]]
[--Filesystem [-lang langid] [-copy | -move | -delete | -copyfile | -movefile | deletefile] [-source source_path] [-dest destination_path] [-include file_masks] [-exclude file_masks] [-overwrite]]
[--Zip [-lang langid] [-compress | -uncompress] [-archive archive_file] [-folder uncompressed_folder] [-include file_masks] [-exclude file_masks] [-overwrite] [-level level] [-password password]]
[--IEAutomation [-lang langid] [-show] [-noclose] [-timeout sec] [-command [argument:value] [param:value]]]
[--ODBCSQL [-lang langid] [-timeout sec] [-fieldmaxlen field_max_len] [-codepage code_page] [-connstr connection_string] [-sql sql_query] [-outfile outfile]]
[--FileCheck [-lang langid] [-exists | -locked] [-file file_name]]
[--IdleTime [-lang langid]]
[--WlanConnect [-lang langid] [-interface interface] [-profile profile] [-attempts number_of_attempts]]
[--WlanDisconnect [-lang langid] [-interface interface] [-allinterfaces] [-profile profile] [-allprofiles]]
[--FindProcess [-lang langid] [-user user_name] [-image image_file]]
[--FindWindow [-lang langid] [-user user_name] [-caption window_caption] [-begins] [-ends] [-contains]]
[--Ping [-lang langid] [-hostname hostname] [-requests requests] [-length length] [-timeout sec] [-ipv4] [-ipv6]]
[--Screenshot [-lang langid] [-type [specified | primary | all]] [-monitor monitor_name] [-format [bmp | jpg | png]] [-destfile file_name] [-quality jpg_quality]]
[--Capture [-lang langid] [-type [image | video]] [-format [bmp | jpg | png]] [-cameratype [specified | none]] [-camera device_name] [-audiotype [specified | none]] [-audio device_name] [-defaultsize] [-size resolution] [-destfile file_name] [-duration seconds] [-quality jpg_quality] [-visible]]
[--File [filename]] [--Pipe [pipename]] [--StdIn] - read command line from a file, a pipe or standard input.
--Execute
-lang
- langid (see below);
-type
- type of execution:
logstdout
- the application will be started with redirected stdin and application's stdout and stderr will be captured. If application is a 16-bit DOS application or a batch file, it will be executed via the command processor;
processuser
- run application as the same user as command line tool (default);
currentuser
- run application as currently logged on user;
localsystem
- run application under LocalSystem account. To run an application under LocalSystem account, the command line tool must be started under the system or administrator account;
logonuser
- logon user (-username
and -password
are required). The specified username and password will be used for executing the application. To run an application on behalf of the specified user, the command line tool must be started under the system or administrator account. The account must have the following privileges: "Act as part of the operating system" (SeTcbPrivilege), "Replace a process-level token" (SeAssignPrimaryTokenPrivilege), "Adjust memory quotas for a process" (SeIncreaseQuotaPrivilege, may be named "Increase memory quotas" or "Increase quotas" in Windows 2000 and NT 4.0), "Bypass traverse checking" (SeChangeNotifyPrivilege) and "Debug programs" (SeDebugPrivilege). You can modify user privileges in Control Panel | Administrative tools | Local Security Policy | User Rights Assignment;
passwordless
- use passwordless authorization (-username
is required). You can use passwordless authorization, but you must make sure that the command line tool is running under the system or administrator account. The account must have the following privileges: "Act as part of the operating system" (SeTcbPrivilege), "Replace a process-level token" (SeAssignPrimaryTokenPrivilege), "Adjust memory quotas for a process" (SeIncreaseQuotaPrivilege, may be named "Increase memory quotas" or "Increase quotas" in Windows 2000 and NT 4.0), "Bypass traverse checking" (SeChangeNotifyPrivilege), "Debug programs" (SeDebugPrivilege) and "Create a token object" (SeCreateTokenPrivilege). You can modify user privileges in Control Panel | Administrative tools | Local Security Policy | User Rights Assignment. Windows Vista and later: the command line tool must be running only under administrator account. Starting from this Windows version, the system account doesn't have the SeCreateTokenPrivilege privilege. This option is available only in Professional and Network Editions;
-username
- SAM-Account-Name or textual SID;
-password
- account password;
-stdin
- standard input data (logstdout
only);
-exefile
- the name of the module to be executed;
-cmdline
- the command line to be executed;
-startin
- the starting directory;
-cmdshow
- the window show state;
-terminate
- number of seconds to terminate started application;
-desktop
- the name of the desktop (Default: WinSta0\Default).
--Message
-lang
- langid (see below);
-type
- type of the message window:
ask
- ask message window;
popup
- popup window;
layered
- transparent window near task bar;
balloon
- balloon tooltip;
toast
- Version 9 and later, toast notification;
default
- Version 9 and later, user's default;
-title
- title of the message window;
-text
- message text;
-timer
- number of second before the message disappears (ask message only);
-buttons
- buttons for the message window (ask message only);
-snd
- sound file to play when message window is displayed;
-bg
- image file (.bmp, .gif or .jpg ) for the window background (only for the popup window message).
--Service
-lang
- langid (see below);
-type
- type of operation with service (start
, stop
, pause
, continue
or check
);
-name
- name of the service;
-startargs
- argument strings passed to a service (start only).
--KillProcess
-lang
- langid (see below);
-user
- SAM-Account-Name or textual SID of the user whose processes may be killed. Use "*" for all users. If omitted, current user's name will be used. This option is available only on the NT based platforms;
-image
- process image file (name of the executable file of the process or full path and executable file name). Wildcards ("*" and "?" are accepted);
-anyway
- kill process without giving it chance to save data;
-restore
- if the window is minimized, restore it before process is killed. If the window is displaying the prompt for saving unsaved data and the option "-restore
" is not selected, the application's button on the taskbar will blink. When the option is selected, the application window will be restored, and the prompt for saving unsaved data will be sent to foreground;
-list
- list all found processes.
Note: If the option "-anyway
" is not selected, Advanced Task Scheduler can terminate only those processes, which have their own windows. If a process does not have its own window, it can be terminated only when the option "-anyway" is selected.
--KillWindow
-lang
- langid (see below);
-user
- SAM-Account-Name or textual SID of the user whose windows may be killed. Use "*" for all users. If omitted, current user's name will be used. This option is available only on the NT based platforms;
-caption
- window caption text;
-begins
- window caption must begin with the specified text;
-ends
- Version 6.0 and later, window caption must end with the specified text;
-contains
- window caption must contain the specified text;
-anyway
- kill process without giving it chance to save data;
-restore
- if the window is minimized, restore it before process is killed. If the window is displaying the prompt for saving unsaved data and the option "-restore
" is not selected, the application's button on the taskbar will blink. When the option is selected, the application window will be restored, and the prompt for saving unsaved data will be sent to foreground;
-list
- list all found processes.
Terminal Services: only windows that are running on the same terminal session as this program will be killed.
--RasDial
-lang
- langid (see below);
-name
- name of the phone book entry;
-auth
- username and password for the specified connection. If omitted, the connection information saved by the last successful connection will be used;
-authbase64
- base64 encoded username and password, tab delimited;
-attempts
- number of attempts to establish the connection.
Note: If the connection with the specified phone book entry is already connected, this command simply returns success and does nothing.
--RasHangUp
-lang
- langid (see below);
-name
- name of the phone book entry;
-allnames
- Version 4.5 and later: terminate all established connections. In earlier versions all connections can be terminated by entering "*" in the "-name" parameter.
--PlaySound
-lang
- langid (see below);
-device
- name of the sound device. If omitted, the default device will be used;
-sound
- sound file.
--TurnOff
-lang
- langid (see below);
-type
- type of operation (turnoff
, standby
, hibernate
,
reboot
, logoff
or monitor
);
-logoff
- SAM-Account-Name of the user to log off. "*" means all users. If omitted, current user's name will be used. This option is available only on the NT based platforms.
Terminal Services: To be able to log off another user's session, you need to have the Query Information and Reset permissions. To modify permissions on a session, use the Terminal Services Configuration administrative tool.
--SendMessage
-lang
- langid (see below);
-computer
- name of the computer;
-msg
- message text.
--SendEMail
-lang
- langid (see below);
-email
- email address. Several email addresses can be separated by comma or semicolon;
-server
- SMTP server name and port number;
-secure
- Connection security (starttls - STARTTLS; smtps - SSL/TLS);
-auth
- username and password for SMTP server;
-authbase64
- base64 encoded username and password, tab delimited;
-sender
- email address of the sender;
-subject
- message subject;
-msg
- message text;
-attach
- file to send as attachment;
-attachmsg
- message to send as attachment.
Professional and Network Editions: Several files and messages can be attached.
--SendKeys
-lang
- langid (see below);
-caption
- window caption text;
-begins
- window caption must begin with the specified text;
-ends
- Version 6.0 and later, window caption must end with the specified text;
-contains
- window caption must contain the specified text;
-sequence
- keys sequence to send.
Terminal Services: keys may be send only to the windows that are running on the same terminal session as this program.
Windows Vista and later: keys cannot be send to the windows that are running with higher privileges than this program.
--HTTP
-lang
- langid (see below);
-url
- URL to download (examples: http://example.com/, http://user:passwd@domain.name/index.php3);
-file
- file name to store downloaded file;
-overwrite
- overwrite already existing file;
-head
- use HEAD method to get only HTTP headers;
-auth
- username and password for HTTP authorization;
-authbase64
- base64 encoded username and password, tab delimited;
-post
- the full data to post in an HTTP POST operation (for example, "postvar1=value1&postvar2=value2&postvar3=value3"). You must make sure that the data is formatted the way you want the server to receive it. Most web servers will assume this data to be url-encoded. This POST is a normal application/x-www-form-urlencoded kind, which is the most commonly used one by HTML forms;
-timeout
- timeout in seconds;
-proxy
- proxy server address and port number;
-proxytype
- type of the proxy server (HTTP or SOCKS4);
-proxyauth
- username and password for the proxy server;
-proxyauthbase64
- base64 encoded username and password, tab delimited;
-useragent
- user-agent name;
-certauth
- use SSL certificate authentication (HTTPS);
-certfile
- SSL Certificate and Private key in pem format;
-certpasswd
- password for Private key, if required.
--FTP
-lang
- langid (see below);
-upload
- upload folder to remote directory;
-download
- download folder from remote directory;
-delete
- delete folder from remote directory;
-uploadfile
- Version 10 and later, upload file to remote directory;
-downloadfile
- Version 10 and later, download file from remote directory;
-deletefile
- Version 10 and later, delete file from remote directory;
-remote
- URL and remote directory or file to upload, download or delete (examples: ftp://ftp.domain.name/, ftps://user:pwd@ftp.com, sftp://ftp.com);
-local
- local directory or file to upload or download;
-include
- include file mask(s) (semicolon separated);
-exclude
- exclude file mask(s) (semicolon separated);
-overwrite
- overwrite already existing file(s);
-purgefile
- delete source file if operation succeeds;
-passive
- use passive mode (like WWW browsers);
-forceutf8
- use UTF8 file names even if UTF8 is not enabled on the server;
-usessl
- use FTP over SSL/TLS (FTPES);
-timeout
- timeout in seconds;
-auth
- username and password for FTP authorization;
-authbase64
- base64 encoded username and password, tab delimited;
-proxytunnel
- tunneling proxy server address and port number;
-proxytype
- Version 6.0 and later, type of the proxy server (HTTP or SOCKS4);
-proxyauth
- username and password for the proxy server;
-proxyauthbase64
- base64 encoded username and password, tab delimited;
-certauth
- Use public key authentication (SFTP) or SSL Certificate (FTPS);
-certfile
- SFTP Public key or SSL Certificate and Private key in pem format;
-certpasswd
- password for Public key or Private key, if required.
--Filesystem
-lang
- langid (see below);
-copy
- copy folder;
-move
- move folder;
-delete
- delete folder;
-copyfile
- Version 10 and later, copy file;
-movefile
- Version 10 and later, move file;
-deletefile
- Version 10 and later, delete file;
-source
- source directory or file;
-dest
- destination directory or file;
-include
- include file mask(s) (semicolon separated);
-exclude
- exclude file mask(s) (semicolon separated);
-overwrite
- overwrite already existing file(s).
--Zip
-lang
- langid (see below);
-compress
- compress file(s) to archive;
-uncompress
- uncompress file(s) from archive;
-archive
- archive file name;
-folder
- directory of uncompressed files;
-include
- include file mask(s) (semicolon separated);
-exclude
- exclude file mask(s) (semicolon separated);
-overwrite
- overwrite already existing file(s);
-level
- compression level (compress only);
-password
- encrypt archive with password.
--IEAutomation
-lang
- langid (see below);
-show
- show browser window;
-noclose
- do not close browser window when finished;
-timeout
- timeout in seconds;
-command
- IE Automation commands;
Several IE Automation commands can be executed one by one.
--ODBCSQL
-lang
- langid (see below);
-timeout
- timeout in seconds;
-fieldmaxlen
- maximum field length;
-codepage
- output code page (0-ACP, 1-OEM, 65001-UTF8);
-connstr
- ODBC connection string;
-sql
- SQL query string;
Several SQL queries can be executed one by one;
-outfile
- Version 6.0 and later, query results can be saved to the specified file.
--FileCheck
-lang
- langid (see below);
-exists
- check if file exists;
-locked
- check if file locked;
-file
- file name to check.
--IdleTime
-lang
- langid (see below).
--WlanConnect
-lang
- langid (see below);
-interface
- name of the WLAN interface;
-profile
- name of the profile;
-attempts
- number of attempts to establish the connection.
Note: If the specified interface is already connected to a wireless network, this command will first disconnect from the currently connected network, then attempt to connect to the new network. However, if these two networks are the same this command simply returns success and does nothing.
--WlanDisconnect
-lang
- langid (see below).
-interface
- name of the WLAN interface;
-allinterfaces
- disconnect the specfied profie (or all profiles) on all interfaces;
-profile
- name of the profile;
-allprofiles
- disconnect all profiles on the specfied interface (or all interfaces).
--FindProcess
-lang
- langid (see below);
-user
- SAM-Account-Name or textual SID of the user whose processes may be killed. Use "*" for all users. If omitted, current user's name will be used. This option is available only on the NT based platforms;
-image
- process image file (name of the executable file of the process or full path and executable file name). Wildcards ("*" and "?" are accepted).
--FindWindow
-lang
- langid (see below);
-user
- SAM-Account-Name or textual SID of the user whose windows may be killed. Use "*" for all users. If omitted, current user's name will be used. This option is available only on the NT based platforms;
-caption
- window caption text;
-begins
- window caption must begin with the specified text;
-ends
- window caption must end with the specified text;
-contains
- window caption must contain the specified text.
--Ping
-lang
- langid (see below);
-hostname
- host name or IP address;
-requests
- number of requests to send;
-length
- Send buffer size;
-timeout
- timeout in seconds;
-ipv4
- Force using IPv4;
-ipv6
- Force using IPv6.
--Screenshot
-lang
- langid (see below);
-type
- monitor type:
specified
- specified monitor;
primary
- primary monitor;
all
- all monitors;
-monitor
- monitor name;
-format
- image format:
bmp
- Windows Bitmap;
jpg
- JPEG image;
png
- PNG image;
-destfile
- destination file;
-quality
- JPEG image quality (0 to 100).
--Capture
-lang
- langid (see below);
-type
- capture type:
image
- take picture;
video
- record video and audio;
-format
- image format:
bmp
- Windows Bitmap;
jpg
- JPEG image;
png
- PNG image;
-cameratype
- type of video capturing device:
specified
- specified device;
none
- no video will be recorded;
-camera
- video capturing device name;
-audiotype
- type of audio capturing device:
specified
- specified device;
none
- no audio will be recorded;
-audio
- audio capturing device name;
-defaultsize
- use default camera resolution;
-size
- resolution (e.g. 640x480);
-destfile
- destination file;
-duration
- duration in seconds;
-quality
- JPEG image quality (0 to 100);
-visible
- show camera window.
--File
Command line will be read from the specified file. Output will be sent to stdout. If command line is in Unicode Little Endian charset, the file must begin with "0xFF 0xFE".
--Pipe
Command line will be read from the specified named pipe (for example, \.\pipe\mypipename). Output will be sent to the same named pipe. Command line must be terminated with the new line character "\n" (0x0A). If command line is in Unicode Little Endian charset, it must begin with "0xFF 0xFE".
--StdIn
Command line will be read from stdin. Output will be sent to stdout. Command line must be terminated with the new line character "\n" (0x0A). If command line is in Unicode Little Endian charset, it must begin with "0xFF 0xFE".
If an argument contains spaces it must be enclosed in the quotes (").
Formats like "&0xhhhh;" are accepted, so to pass a quote mark, use "&0x22;". Note that "hhhh" is a hexadecimal value of a Unicode character.
Use -h
or --help
option to display help information.
Use -l
or --lang
option to display language identifiers (langid).
Categories: Manual
Leave a Reply
You must be logged in to post a comment.