Currently Being Moderated

Repair Computer Script - WMI,MSI, Permissions, Catroot2

VERSION 5

Created on: Jan 25, 2008 3:29 PM by Zman - Last Modified:  Mar 14, 2009 5:09 PM by Zman

Repair Computer Script - WMI,MSI, Permissions, Catroot2

 

Occasionally you will find computers in your environment  that become almost unusable.  Registry and file permissions become either so tight, or they are set incorrectly,  that  applications will not install or error out.   WMI and MSI become corrupt and everything seems to fail. Most times re-imaging  is the only option since it is faster to  re-image than sift through thousands of registry and file permissions.

 

 

Attached is a batch file that repairs:

 

  • WMI

  • MSI

  • CATROOT2 – If corrupt, Microsoft Patches will not install.

  • Resets all file and registry permission back to the default XP settings.

 

 

This batch file has saved me numerous hours of  troubleshooting, and has been run on hundreds of computers without issues. It can be scheduled via LANDesk, or on more desperate cases, run via Psexec.

 

 

It was written in batch since it is one of the lowest common scripting languages (so it should run even if the computer is not in a stable state).

 

 

Warnings:

 

 

Test this before running in your environment! It is safe, however, it does reset registry and file permissions. If any custom registry or file permission were set on “standard” keys/folders, they will be reset.  Also when file permissions are reset, it  creates a lot of file I/O and Virus Scanning apps may consume more CPU cycles.

 

 

I have also had to run it twice on some machines that were in bad shape.

Attachments:
snix snix  says:

Hey zman - love this batch file - one question, you found a way to make it silent?  I've tried inserting the hidedos.exe commands, but then it fails to run as the local system account.  Any suggestions?

Zman Zman  says in response to snix:

What version of LANDesk are you using? You can create a Batch Distribution Package and have a silent delivery method and there is no DOS box/UI. Or if below the version where Batch is not an option in distribution packages, you could use HIDEDOS in a script:

REMEXEC0=<qt></qt>%LDMS_CLIENT_DIR%\sdclient.exe<qt></qt> /p="\\path to hidedos\hidedos.exe" /cmds="cmd /c \\path to wmifixall\wmifixall.bat" /exe /N /An /Ac /lanpps=0 /wanpps=0,ASYNC

 

Paul Hoffmann Paul Hoffmann  says:

A bit late, but better late than never.

 

Please be aware that this information should be used in conjunction with the info provided here:

 

How to fix WMI if it becomes corrupt:

http://community.landesk.com/support/docs/DOC-2302

 

Paul Hoffmann

LANDesk EMEA Technical Lead

LANDesk Community powered by Jive Software's Clearspace ® Subscribe| Legal Notices| Investor Relations| Avocent| Privacy Policy © 2009 LANDesk Software