Jump to content
Sign in to follow this  
tutor2000

LIttle HTA Trick as a Newbie

Recommended Posts

tutor2000

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

Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Share this post


Link to post
Share on other sites
NELyon

Clever ;)

Share this post


Link to post
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
Sign in to follow this  

×