How to use Vbscript in HTA.

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 12 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
enjoyabhi@gmail.com
Posts: 14
Last visit: Sun Jan 22, 2012 2:09 am

How to use Vbscript in HTA.

Post by enjoyabhi@gmail.com »

How can I use the below script in HTA . "wscript.sleep" is not allowed in HTA so what should I use instead of wscript.sleep ?


This script calls a exe file by making use of Runas command . If I am running this script directly it is working fine only in HTA it is not working .

set WshShell = WScript.CreateObject("WScript.Shell") PARAM1="DOMAINabhishek.shukla"PARAM2="pASSWORD"
WshShell.run "runas /user:"&PARAM1&" %comspec%" 'Open command prompt WScript.Sleep 1000 WshShell.SendKeys PARAM2 'send password WshShell.SendKeys "{ENTER}" WScript.Sleep 1000 WshShell.SendKeys Chr(34) + "C:TempFallbacktool.EXE" + Chr(34) WshShell.SendKeys "{ENTER}" WshShell.SendKeys "exit" 'Close command prompt WshShell.SendKeys "{ENTER}" WScript.Sleep 1000
This topic is 12 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked