Batch file to hta

Posted on 2009-04-15
Last Modified: 2012-06-27
HI everyone,

I have the following batch file that I would like to convert to a hta.

Syntax for running it is as follows:

checkhotfixes.bat <computer_name> <hotfixes_list>.txt <output_results>.txt

What id like to do is:

a) Convert this to a hta
b) Have a list box on the hta that takes the place of the text file that lists all hotfixes to be checked.
c) Have a text box that enables you to input the computer name you wish to check
d) A "Run" button that allows you to execute the script
e) Output would be seen in the hta and not written to a text file

Any help on converting this script to a hta would be much appreciated.
@echo off

rem -------------- checkhotfixes.bat

rem -------------- checkhotfixes.bat <computer_name> <hotfixes_list>.txt <output_results>.txt

rem -------------- eg. checkhotfixes.bat serverA kb.txt kbresults.txt


ECHO System: %1>>%3

ECHO KBs to check from %2:>>%3

ECHO KB:          Status:>>%3

ECHO ------------------------->>%3

FOR /f %%k in ('type "%2"') do (

    Set Status=Not installed

    reg query "\\%1\hklm\software\microsoft\windows nt\currentversion\hotfix\%%k" /v Installed | FIND /i "Installed" | FIND "0x1"

    IF NOT ERRORLEVEL 1 Set Status=Installed

    ECHO %%k    !Status!>>%3


Open in new window

Question by:Simon336697
    LVL 7

    Accepted Solution

    Simon, copy similar process I posted for you in

    You'll need to convert the batch script to VBScript.  Shouldn't be too hard, will need to use a VBscript for loop.  (I always had trouble deciphering batch loops tho :-) )

    To output text to the HTA, use the HTML tag <DIV id="TextOutput></DIV>.   Then update if from your script by:
      TextOutput.Value = "text ..."
      TextOutput.Value = TextOutput.value & vbnewline & "new text..."
    LVL 1

    Author Comment

    Thanks so much sj

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
    Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now