BITS commands

Navigation:  Client commands > Tools > Client command editor > Command list >

BITS commands

Version 1.0.0

Show hidden text

The BITS commands serve to manage downloads and uploads of files can be managed with the BITS (Background Intelligent Transfer Service). The downloads/uploads are managed as individual jobs. When transferring files, the BITS automatically performs load balancing to ensure that productive work with power resources can continue without reducing performance.

 

To perform a download or upload of files with BITS, you need at least the commands Add job, Add file(s), Resume job and Complete job. All other commands can be used optionally.

 

5.8.3.2.3 - AddJob

 

Since the BITS is a relatively new service, the correct usage of these commands depends on the respective operating system of the clients. For compatibility reasons, please read the article at: http://msdn.microsoft.com/en-us/library/aa363167(VS.85).aspx

 

For more information about the BITS, please read the article at: http://msdn.microsoft.com/en-us/library/bb968799(VS.85).aspx

 

hmtoggle_arrow1Add job

With this command, you can create a new BITS job. You can perform such a download or upload via the BITS only through this job.

 

First specify if the job should manage a download or an upload. BITS can execute an upload job only from a single file. Then you give a unique name to the job.

 

Last, you create a selected variable. The job ID is saved in this variable. With this ID, additional BITS command can access this job and manage it.

 

hmtoggle_arrow1Add file(s) to job

With this command you can assign files that are to be transferred to a job. These files are later loaded down from or up to a server by means of the job.

 

5.8.3.2.3 - AddFilesToJob

 

First, specify the job ID of the job to which you want to assign the files. You then specify the local storage location and the storage location on a server for each file. In doing so, you mus also enter the file name on the destination system.

 

With the adjacent buttons you can add or remove additional files.

 

hmtoggle_arrow1Resume job

This command starts a job, which then transfers the specified files (see Add file(s) to job). To do this, you first have to specify the job ID of the corresponding job. You then have two options available:

 

1.If you select the option Waiting for full transfer, the client command will continue only if all files were transferred. In all other cases, the client command will continue directly.
2.The second option indicates an error if an error occurs during data transfer.

 

hmtoggle_arrow1Complete job

This command ensures that the specified job (via job ID) is properly terminated. It should always be executed at the end of a job to avoid complications with the BITS.

 

hmtoggle_arrow1Cancel job

With this command, you can cancel a job. Simply enter the job ID of the corresponding job. All commands which subsequently refer to the job, which is cancelled with this command, will report an error, because the job no longer exists.

The Complete job command must not be running.

 

hmtoggle_arrow1Suspend job

With this command, you can interrupt the execution of a job. Simply enter the job ID of the corresponding job. However, the job can be resumed at any time with the Resume job command.

 

hmtoggle_arrow1Get job priority

With this command, you will receive an information about the current priority of the specified job (job ID). The priority is saved as the integer value in a variable to be specified, which can take the following values:        

 

0 = In front, 1 = High, 2 = Normal, 3 = Low

 

hmtoggle_arrow1Set job priotity

With this command, you can assign a new priority to the specified job (job ID). You can do this by selecting the corresponding priority (In front, High, Normal, Low) from a drop-down list. By default the priority is normal.

 

hmtoggle_arrow1Get job info

With this command, you can save various information about the specified job (job ID) in a variable. The variable then contains the following data:

 

Name

Description

Job type

Owner

State

The name of the job (Add job).

A description of the job.

The type is either DownloadJob or UploadJob.

The SID of the user who created the job.

siehe http://msdn.microsoft.com/en-us/library/aa362809(VS.85).aspx

 

The data can be accessed through the variable in the following format:

 

%VariablenName.Information%

 

hmtoggle_arrow1Get notify command line

With this command you can read the notification parameters, which may have been used for a job (see Set notify command line). To do this, enter the job ID of the job, the parameters of which you want to read. The data is stored in a program variable and a parameter variable that you must specify. Due to the architecture of the BITS, the content of the program variable is repeated in quotation marks at the start, which is then followed by the parameters.

 

hmtoggle_arrow1Set notify command line

With this command you can specify a local program or a script or client command, which is automatically launched as soon as the job reaches the status BG_JOB_STATE_ERROR or BG_JOB_STATE_TRANSFERED.

 

5.8.3.2.3 - SetNotifyCommandLine

 

If you have to make a distinction between the two states, you must do so manually in the appropriate program/script or the specified client command, because BITS itself makes no distinction. For this, you can transfer the job ID as a parameter to the program/script or the client command. With the help of the BITSAdmin tool, you can then query the last status via the job ID. You may need an additional script, which can make the distinction and then launches the actual program.

 

Hinweis

Note:

For more information about the BITSAdmin tool, go to the following address:

 

Hinweis

Note:

The client command does not wait until the successful completion of the specified program/script or client command. It is therefore not recommended to access the job via the job ID and the BITSAdmin, since there is a risk that the job has been previously completed with the Complete job command. Assistance may be provided by the Wait for process command in Chapter Processes and Shell Category .

 

hmtoggle_arrow1Set credentials

With this command you can transfer credentials to the job, if this information is required for the server or for a proxy.

 

First specify if the credentials are intended for a server or a proxy. Multiple credentials can be used when files are loaded from different servers.

 

5.8.3.2.3 - SetCredentials

 

To enter the credentials correctly, choose the scheme of the application (Basic, Digest, NTLM, Negotiate or Passport). Then, you specify a user name and a password.

 

Hinweis

Note:

In principle, BITS cannot use any credentials for UNC shares. In this case, you should use the commands listed in the Chapter Internet .

 

Hinweis

Note:

Further information for selecting the scheme is available via the following link:

Scheme http://msdn.microsoft.com/en-us/library/aa362793(VS.85).aspx

IIS configuration http://support.microsoft.com/kb/324276/de

 

hmtoggle_arrow1Remove credentials

With this command you can delete the credentials for a job. To do this, you specify the job ID. Then select whether the data are credentials for a server or a proxy. Finally select the schema, the information of which should be deleted.

 

hmtoggle_arrow1Iterate jobs

With this command you can iterate all BITS jobs are iterated loop-like. In doing so, the job ID as well as the job name are saved in each iteration for the respective current job in the matching variables. In addition, you have to indicate if the only the jobs of the current user or the jobs of all users should be iterated. With the subordinate commands you can further process the information.

 

hmtoggle_arrow1Iterate files of job

With this command you can iterate all files (Add file(s) to job) of a job (job ID). The file path and file name of the local file and the server file will then be saved in the corresponding variable. With the subordinate commands you can further process the information.

Last change on 10.03.2014