locked
MDT 2013 Update 1 - XCOPY is failing on *.ini files. RRS feed

  • Question

  • Prior to upgrading to MDT 2013 Update 1, I was able to use XCOPY in a task sequence to copy files with .ini extensions. Now, it just hangs and I have to use task manager to kill xcopy in order for it to continue. 
    Friday, October 23, 2015 8:41 PM

Answers

  • Dan, I really appreciate your help and work on making that! I was able to get xcopy working by using the cmd /c, but had to quote it.

    cmd /c "xcopy.exe "%DEPLOYROOT%\Applications\SAP\saplogon.ini" "C:\Program Files (x86)\SAP" /Q /E /I /Y"

    • Marked as answer by Ty Glander Friday, October 23, 2015 10:28 PM
    Friday, October 23, 2015 9:46 PM

All replies

  • Can you post BDD.log?

    Logs are very important. If you are unsure how to post logs or where to find them then reference https://keithga.wordpress.com/2014/10/24/video-mdt-2013-log-files-basics-bdd-log-and-smsts-log/ Also if you have made customizations please mention them when asking for help.

    Friday, October 23, 2015 8:47 PM
  • Thanks for the response! I probably should have specified that there is no failure or mention of it in the BDD.log. It just hangs at the copy step and I think when I finally kill XCOPY for it to continue, it checks it as a success to run the command.

    In the task sequence, it is running a command line that is: "xcopy.exe "%DEPLOYROOT%\Applications\SAP\saplogon.ini" "C:\Program Files (x86)\SAP" /Q /E /I /Y

    Nothing changed in the task sequence from when it was working other than the upgrade to 2013 Update 1. 

    Friday, October 23, 2015 8:58 PM
  • try adding cmd /c at the beginning of that command.

    Logs are very important. If you are unsure how to post logs or where to find them then reference https://keithga.wordpress.com/2014/10/24/video-mdt-2013-log-files-basics-bdd-log-and-smsts-log/ Also if you have made customizations please mention them when asking for help.

    Friday, October 23, 2015 9:08 PM
  • Unfortunately it has the exact same results when adding cmd /c to the beginning. 
    • Marked as answer by lunarpowered Friday, October 23, 2015 9:47 PM
    • Unmarked as answer by Ty Glander Friday, October 23, 2015 10:27 PM
    Friday, October 23, 2015 9:27 PM
  • Nothing changed in the task sequence from when it was working other than the upgrade to 2013 Update 1. 

    Except for breaking batch files.
    https://keithga.wordpress.com/2015/08/18/mdt-uberbug05-batch-scripting-is-dead/

    I've converted nearly everything into either powershell or vbscript wrappers.

    If you used a vbscript (.wsf) wrapper you would use a line like

    oFSO.CopyFile oUtility.ScriptDir & "\saplogon.ini", oENV("ProgramFiles(x86)") & "\SAP\", True


    If this post is helpful please vote it as Helpful or click Mark for answer.

    • Proposed as answer by Ty Glander Friday, October 23, 2015 10:27 PM
    Friday, October 23, 2015 9:27 PM
  • Full code

    <job id="SAP configuration">
    <script language="VBScript" src="..\..\scripts\ZTIUtility.vbs"/>
    <script language="VBScript"> 
    
    '//----------------------------------------------------------------------------
    '// Purpose: Used to apply SAP configuration file
    '// Usage: cscript SAPCONFIG.wsf [/debug:true]
    '// Version: 1.0 - October 23, 2015 - Daniel Vega: Initial script
    '//----------------------------------------------------------------------------
    
    '//----------------------------------------------------------------------------
    '// Global constant and variable declarations
    '//---------------------------------------------------------------------------- 
    
    Option Explicit 
    
    Dim iRetVal 
    
    '//----------------------------------------------------------------------------
    '// End declarations
    '//---------------------------------------------------------------------------- 
    
    '//----------------------------------------------------------------------------
    '// Main routine
    '//---------------------------------------------------------------------------- 
    
    On Error Resume Next
    iRetVal = ZTIProcess
    ProcessResults iRetVal
    On Error Goto 0 
    
    '//---------------------------------------------------------------------------
    '//
    '// Function: ZTIProcess()
    '//
    '// Input: None
    '// 
    '// Return: Success - 0
    '// Failure - non-zero
    '//
    '// Purpose: Perform main ZTI processing
    '// 
    '//---------------------------------------------------------------------------
    Function ZTIProcess() 
    
    
    	oLogging.CreateEntry "SAP Configuration: Applying Configuration", LogTypeInfo	
    
    	' Disable Zone Checks
    	oEnv("SEE_MASK_NOZONECHECKS") = 1 
    
    	' Copy configuration file
    	oFSO.CopyFile oUtility.ScriptDir & "\saplogon.ini", oENV("ProgramFiles(x86)") & "\SAP\", True
    
    	' Enable Zone Checks
    	oEnv.Remove("SEE_MASK_NOZONECHECKS")
    
    	oLogging.CreateEntry "SAP Configuration: Finished applying configuration", LogTypeInfo	
    	
    End Function 
    
    </script>
    </job>


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Friday, October 23, 2015 9:35 PM
  • Dan, I really appreciate your help and work on making that! I was able to get xcopy working by using the cmd /c, but had to quote it.

    cmd /c "xcopy.exe "%DEPLOYROOT%\Applications\SAP\saplogon.ini" "C:\Program Files (x86)\SAP" /Q /E /I /Y"

    • Marked as answer by Ty Glander Friday, October 23, 2015 10:28 PM
    Friday, October 23, 2015 9:46 PM
  • You still might want to consider using wrappers since you can script them to provide logs, but glad you got it working.

    If this post is helpful please vote it as Helpful or click Mark for answer.

    Monday, October 26, 2015 2:02 PM