Share via

Copy .xml file to local computer with MDT

w raspe 321 Reputation points
Jan 12, 2023, 6:02 PM

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 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,932 questions
Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
917 questions
Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,959 questions
0 comments No comments
{count} votes

Accepted answer
  1. CherryZhang-MSFT 6,491 Reputation points
    Jan 16, 2023, 8:16 AM

    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,491 Reputation points
    Jan 13, 2023, 7:34 AM

    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 321 Reputation points
    Jan 13, 2023, 1:44 PM

    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.