none
MDT 2012 Running Command Line? RRS feed

  • Question

  • So I wanted to copy some files to the client machine once all the deployment is done from a file server.

    net use Z: \\myfileserver password /user:myfileserver\Administrator && copy Z:\SomeFolder\SomeFiles C:\Myfiles

    A long list of error came out during this step and i tried with and without cmd.exe /c

    I tried running the command manually on the client's machine and there dont seem to be any issue.

    So i tried running net use command only in the Run Command Line and found out that's where the error came.

    Am i missing something on this?

    Sunday, May 19, 2013 8:53 AM

Answers

  • Z: is used by mdt to mapp the deploymentshare, try Another drive letter.
    • Marked as answer by Jack_Tan Monday, May 20, 2013 6:03 AM
    Sunday, May 19, 2013 12:25 PM
  • Hi,

    You can use this MDT script to do the job. Adjust the source location

    Save the script as ZTICopyFolder.wsf (Windows Script File) in your scripts folder. This is needed since it includes the components from the core utility script (ZTIUtility.vbs) from MDT.


    <job id="ZTICopyFolder">
    <script language="VBScript" src="ZTIUtility.vbs"/>
    <script language="VBScript">

    Option Explicit
    Dim iRetVal

    On Error Resume Next
    iRetVal = ZTIProcess
    ProcessResults iRetVal
    On Error Goto 0

    Function ZTIProcess()

     ' Declare the variables
     Dim sSourceFolder
     Dim sTargetFolder

     ' Define Source and Target folders
     sSourceFolder = oEnvironment.Item("DeployRoot") & "\Applications\StuffToCopy"
     sTargetFolder = "C:\Windows\Temp\StuffToCopy"

     oLogging.CreateEntry "Copying " & sSourceFolder & " folder to the local machine", LogTypeInfo

     ' Optional progess logging to the task sequence progress bar
     oLogging.ReportProgress "Copying " & sSourceFolder & " folder to the local machine", 20

     ' Do the actual copying
     oFSO.CopyFolder sSourceFolder, sTargetFolder, true

    End Function

    </script>
    </job>

    script from Johan


    Revue du Geek | Astuces pour déployer Windows 7

    Sunday, May 19, 2013 2:13 PM

All replies

  • Z: is used by mdt to mapp the deploymentshare, try Another drive letter.
    • Marked as answer by Jack_Tan Monday, May 20, 2013 6:03 AM
    Sunday, May 19, 2013 12:25 PM
  • Hi,

    You can use this MDT script to do the job. Adjust the source location

    Save the script as ZTICopyFolder.wsf (Windows Script File) in your scripts folder. This is needed since it includes the components from the core utility script (ZTIUtility.vbs) from MDT.


    <job id="ZTICopyFolder">
    <script language="VBScript" src="ZTIUtility.vbs"/>
    <script language="VBScript">

    Option Explicit
    Dim iRetVal

    On Error Resume Next
    iRetVal = ZTIProcess
    ProcessResults iRetVal
    On Error Goto 0

    Function ZTIProcess()

     ' Declare the variables
     Dim sSourceFolder
     Dim sTargetFolder

     ' Define Source and Target folders
     sSourceFolder = oEnvironment.Item("DeployRoot") & "\Applications\StuffToCopy"
     sTargetFolder = "C:\Windows\Temp\StuffToCopy"

     oLogging.CreateEntry "Copying " & sSourceFolder & " folder to the local machine", LogTypeInfo

     ' Optional progess logging to the task sequence progress bar
     oLogging.ReportProgress "Copying " & sSourceFolder & " folder to the local machine", 20

     ' Do the actual copying
     oFSO.CopyFolder sSourceFolder, sTargetFolder, true

    End Function

    </script>
    </job>

    script from Johan


    Revue du Geek | Astuces pour déployer Windows 7

    Sunday, May 19, 2013 2:13 PM
  • Both worked like a charm. Dint knew Z: was mapped during installation. Thanks!
    Monday, May 20, 2013 6:04 AM