none
Copy SHortcut.lnk file in TaskSequence

    Question

  • Hi

    I have TaskSequence which installs program and after that I need to copy .lnk file from StartMenu to All users\Desktop. Programm installation is successfull. But copy job fail.

    My command line looks like this

    for Windows7

    copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cisco\Desktop\agent.lnk" "C:\Users\Public\Desktop"

    But when Sequence runs I got errors in console that File not found

    "

    The task sequence execution engine failed executing the action (Copy Shortcut 32bit W7) in the group () with the error code 2147942402
    Action output: [ smsswd.exe ]
    PackageID = ''
    BaseVar = '', ContinueOnError=''
    ProgramName = 'copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cisco\Desktop\agent.lnk" C:\Users\Public\Desktop'
    SwdAction = '0001'
    Working dir 'not set'
    Executing command line: Run command line
    CreateProcess failed. Code(0x80070002)
    Command line execution failed (80070002)
    Failed to execute command line 'copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Cisco\Desktop\agent.lnk" C:\Users\Public\Desktop' . 
    he system cannot find the file specified. (Error: 80070002; Source: Windows)
    Install Software failed to run command line, hr=0x80070002. The operating system reported error 2147942402: The system cannot find the file specified. 
    • Edited by Kaspars_ Wednesday, January 22, 2014 12:31 PM mistake
    Wednesday, January 22, 2014 12:30 PM

Answers

  • I copy shortcuts all the time. I use the following Run Command Line step in a task sequence.

    xcopy * c:\users\public\desktop /e /c /y /h
    Just replace the * with the file you need, if its in the same directory you dont need the full path. I use a package that contains the files.

    • Edited by DanielRatliff Wednesday, January 22, 2014 2:02 PM
    • Marked as answer by Kaspars_ Wednesday, January 22, 2014 2:51 PM
    Wednesday, January 22, 2014 2:01 PM

All replies

  • I copy shortcuts all the time. I use the following Run Command Line step in a task sequence.

    xcopy * c:\users\public\desktop /e /c /y /h
    Just replace the * with the file you need, if its in the same directory you dont need the full path. I use a package that contains the files.

    • Edited by DanielRatliff Wednesday, January 22, 2014 2:02 PM
    • Marked as answer by Kaspars_ Wednesday, January 22, 2014 2:51 PM
    Wednesday, January 22, 2014 2:01 PM
  • Worked like a charm.

    Thanks

    Wednesday, January 22, 2014 2:51 PM