Copy .xml file to local computer with MDT

w raspe 336 Reputation points
2023-01-12T18:02:18.1233333+00:00

Hi Team,

I am using MDT 2004 on my own device, trying to create a offline installation media.

The installation is good, but it fails when I want to copy a .xml file to the computer inside hyper-v machine.

I get the below error message

wdk

On server level I created the below script and this works fine.

New-Item -ItemType directory -Path C:\Windows\Temp\Layout

Copy-Item -path \Server\Scripts\layout* -Destination C:\Windows\Temp\Layout

cd C:\Windows\Temp\Layout

Import-StartLayout -LayoutPath C:\Windows\Temp\Layout\Customlayout.xml -MountPath $env:SystemDrive\


Now when I trying on my own laptop I am using below script

New-Item -ItemType directory -Path C:\Windows\Temp\Layout

xcopy.exe "%deployroot%\Scripts\Layout\Customlayout.xml" "C:\Windows\Temp\Layout" /Q /H /E /I /Y

cd C:\Windows\Temp\Layout

Import-StartLayout -LayoutPath C:\Windows\Temp\Layout\Customlayout.xml -MountPath $env:SystemDrive\

above script is not working and I tried few xcopy commands.

Could someone tell me the best way to copy files to the machine?

Windows for business Windows Client for IT Pros Devices and deployment Set up, install, or upgrade
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. CherryZhang-MSFT 6,496 Reputation points
    2023-01-16T08:16:07.0166667+00:00

    Hi @w raspe ,

    Thanks for your feedback and sharing. We're glad that the question is fixed now. Here's a short summary for the problem, we believe this will help other users to search for useful information more quickly. It's appreciated that you could click "Accept Answer" to the reply.

    Problem/Symptom:
    Copy .xml file to client computer with MDT, the script does not work.

    Solution/Workaround:

    Modify the script to the following example and the correct order inside MDT show as screenshot.

    cd C:\Windows\Temp\Layout

    *Import-StartLayout -LayoutPath C:\Windows\Temp\Layout\SMenu1.xml -MountPath $env:SystemDrive*

     Picture1

    Thanks again for your time! Have a nice day!

    Best regards,
    Cherry

     

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. CherryZhang-MSFT 6,496 Reputation points
    2023-01-13T07:34:07.9933333+00:00

    Hi @ w raspe ,

    1, Is the script used on server level also use an offline installation media?

    2, Can you find the Customlayout.xml under the path of LiteTouchMedia.iso\Deploy\Scripts\Layout... on the offline media? For example:

    1

    3, Please upload a full smsts.log for our reference.

    4, Besides, I found some similar threaders. They solved thsi problem through “create applications that contained a batch file which runs the same command”.

    The link for your reference:

    https://www.reddit.com/r/MDT/comments/bm6ngm/copy_file_during_deployment/

    [https://community.spiceworks.com/topic/2242752-best-way-to-copy-files-in-mdt

    Note: Microsoft provides third-party contact information to help you understand the problem. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

    I will do more research; I will be sharing for you if I have any update.

    Thanks for your time.

    Best regards,
    Cherry

     

     


  2. w raspe 336 Reputation points
    2023-01-13T13:44:13.3033333+00:00

    Hi @CherryZhang-MSFT ,

    I have edit the Offline TS with 3 actions to apply the custom startmenu.

    action 1. : created a powershell script with following content:

    New-Item -ItemType directory -Path C:\Windows\Temp\Layout

    action 2: After creating the folder Layout, copy the below files with creating the application, like you mention.

    User's image

    action 3: created another powershell script with following content:

    cd C:\Windows\Temp\Layout

    Import-StartLayout -LayoutPath C:\Windows\Temp\Layout\SMenu1.xml -MountPath $env:SystemDrive\

    Below the correct order inside MDT

    User's image

    This works for me!!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.