Batch file to hta

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

Who is Participating?
sj_hicksConnect With a Mentor Commented:
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..."
Simon336697Author Commented:
Thanks so much sj
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.