hta

How to open a pdf with WScript.Shell

落爺英雄遲暮 提交于 2019-12-05 08:00:48
问题 I'm creating a HTA application that needs to open PDF document. I cannot assum that the user will have acrobat installed on his PC as in this example The WScript (documentation) allow you to run a command line application. But what I would like, is for the WScript to simulate a double click on the file. I would like to be able to do something like var wshShell = new ActiveXObject("WScript.Shell"); wshShell.Exec(pdfFilePath); // That does not work 回答1: In cmd , you can open a file like this:

Executing an HTA Application via PSEXEC with command line arguments

▼魔方 西西 提交于 2019-12-04 21:59:44
I have an .hta application that accepts two command line arguments. Executing the application on the remote machine via command line works just like the following (command line - cmd)Example: C:\Users\<user>\Desktop>MSI-BUILDER.hta "MSI_APP" "D:\APP\15.9.98" But when using my desktop trying to execute the same command on the remote machine via PSEXEC I see the application running in task manager but nothing happens. The first steps were assigning the command line arguments to variables in PowerShell: $arg1 = "MSI_APP" $arg2 = "D:\APP\15.9.98" and executing this command in PowerShell fails (no

change HTA application window size

冷暖自知 提交于 2019-12-04 07:30:34
is there any way to change the size of an HTA application? thanks <script type="text/javascript"> window.resizeTo(300,290); </script> Javascript and VBScript ways to size the HTA on loading, to 1/4 the screen area (half the height, half the width) and center it - using screen.availWidth and screen.availHeight : <SCRIPT LANGUAGE="javascript"> function Window_onLoad(){ // resize to quarter of screen area, centered window.resizeTo(screen.availWidth/2,screen.availHeight/2); window.moveTo(screen.availWidth/4,screen.availHeight/4); } window.onload=Window_onLoad; </SCRIPT> In VBSScript a Window

Launch Program after Password Verification

a 夏天 提交于 2019-12-04 06:43:46
问题 I need some help, I have found this password program on the Internet, it is perfect, but there is one problem.What I would like to do, once the password is verified, launch my other program that I have made, the other program that I have made is HTA (Hyper Text Application), is there anyway that I can do this? Here is the code: package components; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.Arrays; /* PasswordDemo.java requires no other files. */ public

How to add filter to a file chooser in batch?

老子叫甜甜 提交于 2019-12-04 02:35:33
问题 I'm using this code to create a file chooser with batch File / folder chooser dialog from a Windows batch script @echo off set dialog="about:<input type=file id=FILE><script>FILE.click();new ActiveXObject set dialog=%dialog%('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value); set dialog=%dialog%close();resizeTo(0,0);</script>" for /f "tokens=* delims=" %%p in ('mshta.exe %dialog%') do set "file=%%p" echo selected file is : "%file%" pause So my question is : How to add

How to open a pdf with WScript.Shell

*爱你&永不变心* 提交于 2019-12-03 21:53:35
I'm creating a HTA application that needs to open PDF document. I cannot assum that the user will have acrobat installed on his PC as in this example The WScript ( documentation ) allow you to run a command line application. But what I would like, is for the WScript to simulate a double click on the file. I would like to be able to do something like var wshShell = new ActiveXObject("WScript.Shell"); wshShell.Exec(pdfFilePath); // That does not work In cmd , you can open a file like this: start c:\path\to\file.pdf Maybe this works wshShell.Exec("start " & pdfFilePath); //do you do string concat

Using Javascript in HTA file to read/write from Windows registry

谁说我不能喝 提交于 2019-12-03 20:28:02
问题 I'm currently attempting to write Javascript in order to read and write from the Windows registry in an HTA file. Here is the current code I am using to write: writeInRegistry = function (sRegEntry, sRegValue) { Regpath = "HKEY_LOCAL_MACHINE\\Software\\CompanyName\\CompanyValues\\" + sRegEntry; try { var oWSS = new ActiveXObject("WScript.Shell"); oWSS.RegWrite(Regpath, sRegValue, "REG_DWORD"); oWSS = null; } catch (e) { alert('Error trying to write "' + sRegValue + '" to registry entry "' +

VBS that triggers a macro via HTA (Cannot run the macro)

风格不统一 提交于 2019-12-02 23:34:49
问题 I have a HTA script which ultimately triggers the vbs portion of the code to call a VBA macro but for some reason I'm getting this error: I've already made sure that Trust access to VBA is enabled so I feel like it's something in my code that isn't HTA compatible. Here is the code: Thank you in advance for you time. <html> <title>Report Generation</title> <head> <HTA:APPLICATION APPLICATIONNAME="Report Generation" ID="objHTA" SCROLL="yes" SINGLEINSTANCE="yes" WINDOWSTATE="normal"> </head>

When does InnerHTML execute immediately?

痴心易碎 提交于 2019-12-02 15:06:50
问题 I would expect this HTA code to print a to be replaced some time later by b . However, what it does is it prints nothing for some time, and then b . With the MsgBox line enabled, it does print a first. It seems that the execution of statusinfo.InnerHTML = "a" is postponed. Can any body tell me why this is? And how would I obtain the desired behavior (immediate refresh)? <SCRIPT LANGUAGE=VBScript> Sub doThis() statusinfo.InnerHTML = "a" 'MsgBox "stop" intensiveOperation statusinfo.InnerHTML =