Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For Windows 7 clients check out the <a href="http://msdn.microsoft.com/en-us/library/dd323778(VS.85).aspx" rel="nofollow noreferrer">Windows Troubleshooting Platform</a>. Here is a <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=48c2fc09-c3e0-4188-8f4f-216e0c25df1d#tm" rel="nofollow noreferrer">download</a> on it with more details. It uses PowerShell scripts to do exacty what you're talking about. This <a href="http://www.withinwindows.com/2009/01/12/crash-course-on-authoring-windows-7-troubleshooting-packs/" rel="nofollow noreferrer">blog post</a> shows how to author a troubleshooting pack - it's pretty easy. </p> <p>I don't think WTP works on downlevel platforms. In this case, I would just write some PowerShell scripts to detect and fix root causes. If you want to wrap that up in a nice UI, check out <a href="http://huddledmasses.org/powerboots/" rel="nofollow noreferrer">PowerBoots</a> - an easy way to create a WPF GUI on top of your script. If you want to host PowerShell in your on C#-based GUI it is very simple. Here's a code snippet from a Forms app:</p> <pre><code> private void button1_Click(object sender, EventArgs e) { string cmd = @"Get-ChildItem $home\Documents -recurse | " + "Where {!$_.PSIsContainer -and " + "($_.LastWriteTime -gt (Get-Date).AddDays(-7))} | " + "Sort Fullname | Foreach {$_.Fullname}"; using (Runspace runspace = RunspaceFactory.CreateRunspace()) { runspace.Open(); using (Pipeline pipeline = runspace.CreatePipeline(cmd)) { this.Cursor = Cursors.WaitCursor; pipeline.Commands.AddScript(cmd); Collection&lt;PSObject&gt; results = pipeline.Invoke(); foreach (PSObject obj in results) { listBox1.Items.Add(obj); } this.Cursor = Cursors.Default; } } } </code></pre> <p>You need to add a reference to the System.Management.Automation assembly. If you have installed the Windows/.NET SDK that should be in ProgramFiles\ReferenceAssemblies\Microsoft\WindowsPowerShell\v1.0. You will also need a couple of using statememets:</p> <pre><code>using System.Collections.ObjectModel; using System.Management.Automation; using System.Management.Automation.Runspaces; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload