Using HTA in vbscript

前端 未结 2 2013
灰色年华
灰色年华 2021-01-14 06:22

While using HTA userform for VBscript, I found that HTA doesn\'t support WScript and its objects/methods.

Is there any alternate way of creating userform or is thery

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-14 06:47

    Put your Wscript code to a .wsf-file and call the script like this:

    shell=new ActiveXObject('WScript.Shell');
    shell.Exec('WScript //Job:job_id PATH_TO_YOUR_WSF_FILE');
    

    Via .wsf you can use also methods like WScript.Sleep(), WScript.SendKeys() etc. which are not available in HTA.

    More info at MSDN: Windows Script Host

提交回复
热议问题