Jump to content


  • 0
Miciuleinen

CMTrace set as default LOG viewer during OSD

Question

Hello,

 

I am trying to deploy CMTrace as part of the TS (SCCM 2012 SP1, no MDT integration) and also set it as default log viewer.

This is my powershell script:

 

$RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"
Copy-Item -Path $RelativePath"CMTrace.exe" -Destination "c:\temp\" -Force
xcopy "c:\temp\CMtrace.exe" "c:\windows\System32" /y
xcopy "c:\temp\CMtrace.exe" "c:\windows\SYSWOW64" /y
$CMtraceKey = "HKCU:\SOFTWARE\Microsoft\Trace32"
Set-ItemProperty -Path $CMtraceKey -Name "Register File Types" -Value 00000000
$Parameters = "assoc .log=logfile"
cmd.exe /c $Parameters

 

The xcopy commands do not work for some reason, and smsts log doesn't show me anything.

 

Can somebody advise on why the copy commands do not work and how can I apply the HKCU key properly ?

 

Thanks

  • Like 1

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I have found a partial solution. For copying I needed to use sysnative instead of system32, to avoid folder redirection.

Also with the help from this blog I have found how to properly set file association.

 

One more thing missing, how to set the HKCU reg key properly, because now cmtrace asks if it is default viewer every time it gets opened.

 

Thanks

Share this post


Link to post
Share on other sites

  • 0
On 12/3/2015 at 11:56 AM, Miciuleinen said:

I have found a partial solution. For copying I needed to use sysnative instead of system32, to avoid folder redirection.

Also with the help from this blog I have found how to properly set file association.

 

One more thing missing, how to set the HKCU reg key properly, because now cmtrace asks if it is default viewer every time it gets opened.

 

Thanks

It would be much more useful if you could share the script here if you succeeded!

Share this post


Link to post
Share on other sites

  • 0
On 12/3/2015 at 8:58 AM, Miciuleinen said:

Hello,

 

I am trying to deploy CMTrace as part of the TS (SCCM 2012 SP1, no MDT integration) and also set it as default log viewer.

This is my powershell script:

 

$RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path -parent)+"\"
Copy-Item -Path $RelativePath"CMTrace.exe" -Destination "c:\temp\" -Force
xcopy "c:\temp\CMtrace.exe" "c:\windows\System32" /y
xcopy "c:\temp\CMtrace.exe" "c:\windows\SYSWOW64" /y
$CMtraceKey = "HKCU:\SOFTWARE\Microsoft\Trace32"
Set-ItemProperty -Path $CMtraceKey -Name "Register File Types" -Value 00000000
$Parameters = "assoc .log=logfile"
cmd.exe /c $Parameters

 

The xcopy commands do not work for some reason, and smsts log doesn't show me anything.

 

Can somebody advise on why the copy commands do not work and how can I apply the HKCU key properly ?

 

Thanks

In a task sequence, would this be applied before or after the "Apply Operating System Image" ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.