Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

Scriptomatic on Windows 7 Solved

Posted on November 20, 2011February 13, 2016 by Alan

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. robin850 says:
    January 20, 2012 at 1:51 PM

    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

  2. Alan says:
    January 24, 2012 at 10:02 AM

    No, my fault. I continue to have issues with BlogJet. The link is fixed.

Leave a Reply

You must be logged in to post a comment.

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy