user3838046
user3838046

Reputation: 21

Copying Files in MDT 2013

I am working to automate deployment of Windows 7 along with several application on some XP laptops.

I am able to silently install the OS and most applications but I am having an issue just copying files (no installation) from my DeploymentShare to the target machine.

I am new to MDT and it seems that, in previous versions, the DeploymentShare/$OEM$ dir could be used to copy files - where $1 signifies C:\ and the directory hierarchy created in the DeploymentShare would be copied to the corresponding directories on the target machine. However, this technique is not working in MDT 2013.

I then tried to copy the files using a Run Command Line task in the Task Sequence. This seems like the simplest way to copy over files.

It is my understanding that %deployroot% within a Media is set as ..\DeploymentShare\ , so I could copy a file from the MDT Media,

C:\DeploymentShare\CopyFiles\fileToCopy.txt

to the target machine,

C:\targetDirectory

with

cmd /c xcopy.exe “%deployroot%\CopyFiles\fileToCopy” “C:\targetDirectory″ 

However, this Run Command Line task gives me the error: Deployment Failed, the system cannot open the file specified.

What is the default path of %deployroot%? How is it set and how can I access files in the DeploymentShare in order to copy them to the target machine?

First post, I hope it is clear.

Upvotes: 1

Views: 15784

Answers (3)

Iggy Pi
Iggy Pi

Reputation: 1

I had the same issue a couple years back and the prob was xcopy had issues with empty subfolders. Try this one

cmd /c /e /r /k xcopy.exe “%deployroot%\CopyFiles\fileToCopy” “C:\targetDirectory″ 

And now off, have a great weekend ;)

Upvotes: 0

Konstantin V
Konstantin V

Reputation: 583

I would suggest using robocopy.

robocopy .\CopyFiles\fileToCopy c:\TargetDirectory /COPY:DASTO /E /V /R:1 /W:1 /XO

This has been working for me so far like a charm and it lets you copy full directories. Hopefully that helps.

Upvotes: 1

user3838046
user3838046

Reputation: 21

I was able to copy files over to the target system by adding this script to the Task Sequence to copy the directory structure found in $OEM$ of the DeploymentShare.

I believe older versions of MDT would copy these files over by default. $OEM$ requires a certain directory labeling - where $$ is the Windows directory and $1 is C:\

Upvotes: 1

Related Questions