Copy CMTrace.exe into the Full Windows OS in a task sequence


I often work with customers using operating system deployment. We usually end up using CMTrace.exe (Log viewing tool for ConfigMgr 2012) to troubleshoot or understand what's happening in the background.

This is really easy to do in WinPE (Windows PE) portion of a task sequence since CMTrace.exe is built into the boot image in ConfigMgr 2012 R2.


Once the task sequence installs the operating system, it will then reboot into the full operating system from WinPE. Viewing logs becomes a little more tricky now since CMTrace.exe is not built into any of our operating systems.

You would have to map a network drive to a location where CMTrace.exe is located to view logs in while running a task sequence after you are in the full OS.

Adding CMTrace.exe into the full OS:

I’m going to show an easy way to copy CMTrace.exe while still in WinPE phase of the task sequence to the volume where the OS WIM was applied.

We will use the “Run Command Line” step in the task sequence right after the “Apply Operating System” step. At this point of the task sequence, we are still in WinPE so we will have access to CMTrace.exe from the X: drive.

The command line we need to run is for x64 boot images: cmd /c xcopy x:\sms\bin\x64\CMTrace.exe %OSDTargetSystemDrive%\windows\system32\ /E /H /C /I /Q /Y

The command line we need to run is for x86 boot images: cmd /c xcopy x:\sms\bin\i386\CMTrace.exe %OSDTargetSystemDrive%\windows\system32\ /E /H /C /I /Q /Y

This is simply going to copy CMTrace.exe WinPE / X: drive to the volume where the OS WIM file was applied.


This will allow us to run CMTrace.exe when we get into the full OS portion of the task sequence or anytime after the task sequence is completed as well.

If you are running a “Build and Capture” task sequence it would probably make more sense to run this step during that instead of the deploy task sequence.

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of any included script samples are subject to the terms specified in the Terms of Use

Comments (11)

  1. Ed (DareDevil57) says:

    thank you.

  2. That is what this is doing. You could run this step in a build and capture as well to automate it.

  3. Bill Dunn says:

    I just drop it into the c:windowssystem32 on my reference image… 😉

  4. Robert says:

    Hi Justin, I adapted this into my task sequence but if I use the command ‘cmd /c xcopy x:smsbinx64CMTrace.exe %OSDTargetSystemDrive%windowssystem32 /E /H /C /I /Q /Y’ it seems that the TS is halted and in background the cmd.exe/xcopy command is actually
    waiting for confirmation if the destination is a folder to be created.

  5. Nalin says:

    Thanks. Just works as demonstrated on the page. The prblem is that in sme versions of SCCM 2012 it looks like Ms has taken away the F8 feature. So once the new windows image has been applied you no longer have access to F8 command console. How does one
    get cmtrace console up and running ?

  6. @Nalin I’m not aware of these changing to this command prompt works fine for me in the full OS part of the TS

  7. ML49448 says:

    To avoid halting the TS just add a "" at the end of "System32" like this: cmd /c xcopy x:smsbinx64CMTrace.exe %OSDTargetSystemDrive%windowssystem32 /E /H /C /I /Q /Y

    Got the same problem with the halted TS and solved it.

  8. Keith says:

    Why use xcopy and not just copy?

  9. Grumpy Monkey says:

    Please note that this seems to have been dropped in R2 SP1 CU1 as my boot media no longer contains CMTrace.exe. I have had to add it manually to the boot media.

  10. Tim Naami says:

    I’m having a problem with CMTrace.exe. When I copy to clipboard it is only copying around 17 lines. I have filtered a log file to 2600 or so entries. How do I get all of those copied over?

  11. Manu21 says:

    Another Manual process.
    Just keep the cmtrace.exe ready on a network share.
    Map a drive to this network share while running TS in Full OS.
    You now have the access to the cmtrace.exe which you can copy to another drive on system that is running the TS.
    Simply open the cmtrace.exe and hit File>>Open menu to navigate to the location of the required logs.

Skip to main content