Share via


Creating a Copy File Task

Note  This content applies to the Windows Logo Kit (WLK). For the latest information using the new Windows Hardware Certification Kit (HCK), see Windows HCK User's Guide on the Windows Hardware Dev Center.

Tasks perform the work of a job. A Copy File task copies files from a source location to a location on the client computer. For more information about tasks, see Basic Task Concepts.

To define a Copy File task

Note  This content applies to the Windows Logo Kit (WLK). For the latest information using the new Windows Hardware Certification Kit (HCK), see Windows HCK User's Guide on the Windows Hardware Dev Center.

  1. Create or edit a Copy File task within a job.

  2. For some tasks, it might be acceptable for the task to succeed eventually, even if the task does not succeed the first time it is run. For example, it might be appropriate to retry a task that uses an unstable network connection.

    If this task should be rerun when it fails, provide the following information:

    1. In the On failure, retry the task x times box, enter the number of times that the task should be rerun. If the task still does not pass after it has been rerun the specified number of times, the task will fail.

    2. In the at an interval of x seconds box, enter the number of seconds that should elapse before the task is rerun.

  3. On the Copy Files tab, click Add.

  4. In the Add Copy File dialog box, enter a Universal Naming Convention (UNC) path to the location of the files to be copied.

    Note   The source path can contain wildcards.

  5. Select the destination on the client computer that the files should be copied to. Select Job's working directory to copy the files to a system-generated directory that will be deleted when the job completes, or select Custom and enter a local path on the client computer. Since this job might run on multiple client computers, do not use specific drive letters. To use an environment variable such as %TEMP% as part of the local path, see Job Parameters.

  6. If this task should copy all subdirectories below the source directory, then select Recursive.

  7. Click OK to close the Add Copy File dialog box.

  8. In the User Context section of the Execution Options tab, select one of the following user contexts and sessions that will be used to run the task on the client computer:

    • Run in System Context to run in the system context (also called "session zero" or "console") on the client computer. There is no desktop associated with the system context, and therefore no display. Services commonly run in the system context.

    • Run as the user that is logged onto the first active session to run in the context of the user that is logged on to the first active session on the client computer. If no user is logged on to the client computer, the task will fail.

    • Run as user in user's active session to run as a specific user, if that user is logged on to the client computer. If the user is not logged on, the task will fail.

    • Run as user in Console if logged in to run as a specific user if that user is logged on to the client computer. However, the task will run in session zero rather than in the user's session. If the user is not logged on, the task will fail.

    • Run as user in Console even if not logged in to run as a specific user in session zero, even if the user is logged on to the client computer.

  9. If you selected Run as user in user's active session, Run as user in Console if logged in, or Run as user in Console even if not logged in, then use the following procedure to identify the user:

    1. In the User Credentials section of the Execution Options tab, select Run as Specific User to identify the user by user name, or select Run as Local Logical User to identify the user by using a Local Logical User (LLU).

    2. If you selected Run as Specific User, enter the user name and domain of the user to run as. If the User Context is Run as user in Console even if not logged in, also enter the user's password.

      Important   The password is stored on the controller and is not secure.

    3. If you selected Run as Local Logical User, enter the LLU as the Local Name.

  10. Click OK to return to the New Job window.

 

 

Build date: 9/14/2012