Get Output of a PowerShell Script in a HTA

前端 未结 3 1489
无人及你
无人及你 2020-12-10 07:25

I am trying to call a powershell script from HTML Application [HTA] as :

Set WshShell = CreateObject(\"WScript.Shell\")

Set retVal = WshShell.Exec(\"powersh         


        
3条回答
  •  时光说笑
    2020-12-10 07:59

    This works for me:

    test.ps1:

    (Get-Process).Count | Out-File c:\temp\output.txt -Encoding ascii
    

    test.hta:

    
    HTA Test
    
    
    
        

提交回复
热议问题