Scriptomatic on Windows 7 Solved

I have been writing HTA files for a years as a way to improve the appearance of some of my scripts.  MSDN has a good article from May of 2011 about the power and utility of HTA files.  After moving to Windows 7 x64, I was disappointed to find that one of my favorite HTA files, Scriptomatic, had quit working.  Scriptomatic is a Microsoft utility that writes WMI code.  Unfortunately when running Scriptomatic I got this error on line 177, character 4:  “Could not complete the operation due to error 80041003”.  If you look at the code the line is: Set objWMIService = GetObject(“winmgmts:\\” & _strWMISource & “\” & strNameSpace) If you look up the error you find that it is WBEM_E_ACCESS_DENIED, “Current user does not have permission to perform the action.” If you search this problem with Scriptomatic in Google, you will find a slew of answers concluding that your only choice is to run the tool as an administrator.  This is true with the code as is, but I thought it would be more interesting to fix the problem, which is ultimately an error handing issue.  Scriptomatic tries to enumerate all of WMI.  An ordinary user cannot access all of WMI, so it fails with a permission error.  My version of Scriptomatic (Fixed_Scriptomatic.hta) adds error handling so an ordinary user can enumerate classes where there is permission to do so. Why do this?  I have another project where an ordinary user uses an HTA to get computer information.  I wanted to make sure that there would be no problems. My version of Scriptomatic adds error handling.  I have commented all of my changes.  If you are uneasy, then I suggest you download the original file and compare.  If you run my fixed version as an ordinary user, it will take a really long time to open.  On my system, a full two minutes. But the resulting list will be good for the current user’s credentials.  Note that HTA files run best from the local computer.

(Update: 1–24–12.  Fixed the embarrasing lack of a link to the file)

2 thoughts on “Scriptomatic on Windows 7 Solved

  1. this sounds awesome, but I am unable to find the link to download your version of scriptomatic?

    did i miss a link somewhere?

    cheers,

    robin850

Leave a Reply