locked
How to copy files during Windows 8.1 Deployment? RRS feed

  • Question

  • I need to copy a folder and all its contents to the root of the C drive of a Windows 8.1 tablet and then copy a shortcut that points to a file in that folder to the desktop task bar of all users on this Windows 8.1 system?

    Can this be done as a "Run command" of is there a better way of doing this?

    Tuesday, January 6, 2015 1:35 AM

Answers

  • I would write a powershell script.

    Start with

    Copy-Item $Source $Destination -Recurse

    Where you set $source and $destination variables respectively.

    Then you can use the following as an example to pin internet explorer to task bar:

    $shell = new-object -com "Shell.Application" # Shell Object Decalaration
    $folder = $shell.Namespace('c:\program files\internet explorer')# Program location
    $item = $folder.Parsename('iexplore.exe')# Program
    $item.invokeverb('taskbarpin')# Pin it!

    http://www.deploymentshare.com/post/Pin-Items-to-Task-Bar

    Which I have tested on Windows 8 and Server 2012.  Pinning the Icons for all users is a slightly different option though. May need a little more research there or perhaps one extra line of code in the above sample.

    Thereafter you can save your scripts somewhere and add it in as a powershell step, calling the scripts from where it is and adding any parameters you wish.

    Hope this helps you.
    Jonnie


    MCP, MCTS, MCITP, MCSA.. Gunning for MCSE Cloud | Please visit www.deploymentshare.com | If I help you solve your issue please mark my reply as the answer.

    • Marked as answer by MyGposts Wednesday, January 7, 2015 12:05 AM
    Tuesday, January 6, 2015 11:21 PM
  • You actually require some code to pin stuff to the taskbar. This might work:

    http://blogs.technet.com/b/deploymentguys/archive/2009/04/08/pin-items-to-the-start-menu-or-windows-7-taskbar-via-script.aspx


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marked as answer by MyGposts Wednesday, January 7, 2015 12:05 AM
    Tuesday, January 6, 2015 9:48 PM

All replies

  • I would go for a copy.cmd which does the following:

    xcopy "%~DP0*.*" "C:\New Folder"
    copy "%~DP0*.lnk" "C:\Users\Public\Desktop"

    Import this stuf as an application in MDT, and in the installation string, specify copy.cmd


    If this post is helpful please click "Mark for answer", thanks! Kind regards

    Tuesday, January 6, 2015 9:41 AM
  • It is this desktop "taskbar" that the shortcut needs to go, not on the desktop itself. 

    What is the path to copy files to Public or Default User desktop taskbar?


    Tuesday, January 6, 2015 1:40 PM
  • You actually require some code to pin stuff to the taskbar. This might work:

    http://blogs.technet.com/b/deploymentguys/archive/2009/04/08/pin-items-to-the-start-menu-or-windows-7-taskbar-via-script.aspx


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marked as answer by MyGposts Wednesday, January 7, 2015 12:05 AM
    Tuesday, January 6, 2015 9:48 PM
  • I would write a powershell script.

    Start with

    Copy-Item $Source $Destination -Recurse

    Where you set $source and $destination variables respectively.

    Then you can use the following as an example to pin internet explorer to task bar:

    $shell = new-object -com "Shell.Application" # Shell Object Decalaration
    $folder = $shell.Namespace('c:\program files\internet explorer')# Program location
    $item = $folder.Parsename('iexplore.exe')# Program
    $item.invokeverb('taskbarpin')# Pin it!

    http://www.deploymentshare.com/post/Pin-Items-to-Task-Bar

    Which I have tested on Windows 8 and Server 2012.  Pinning the Icons for all users is a slightly different option though. May need a little more research there or perhaps one extra line of code in the above sample.

    Thereafter you can save your scripts somewhere and add it in as a powershell step, calling the scripts from where it is and adding any parameters you wish.

    Hope this helps you.
    Jonnie


    MCP, MCTS, MCITP, MCSA.. Gunning for MCSE Cloud | Please visit www.deploymentshare.com | If I help you solve your issue please mark my reply as the answer.

    • Marked as answer by MyGposts Wednesday, January 7, 2015 12:05 AM
    Tuesday, January 6, 2015 11:21 PM