Jump to content

LIttle HTA Trick as a Newbie


tutor2000
 Share

Recommended Posts

I started the script then need to click a button for the program to execute so just starting the program was not an option

Generate this as part of your hta generation

$hta = $hta &@CRLF& '<script language="VBScript"> '

$hta = $hta &@CRLF& 'Sub RunProgram '

$hta = $hta &@CRLF& 'document.title="Run Program by NewbieServices.com"'

$hta = $hta &@CRLF& 'End Sub'

$hta = $hta &@CRLF& '</script> '

$hta = $hta &@CRLF& '</head><body> <button onclick="RunProgram">Run Program</button>

Now the button will rename the window

Then place this in your autoit script

Run(@ComSpec & " /c start "&@ScriptDir&"\DumbSubmitMenu.hta",@ScriptDir,@SW_HIDE) ;or whatever the name of your hta is

WinWait("DumbSubmit by NewbieServies.com","")

WinActivate("DumbSubmit by NewbieServies.com", "")

WinMove("DumbSubmit by NewbieServies.com", "", 0, 0, 300, 300)

WinSetOnTop("DumbSubmit by NewbieServies.com","",1)

while WinExists("DumbSubmit by NewbieServies.com","")

sleep(1000)

WEnd

The program will now wait until the window no longer exists which it doesn't when you click the vbscript button and rename the window

Just a new trick I learned as a newbie

Rick

Edited by tutor2000
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...