hta

Using file input element in hta file prevents deleting selected file

自古美人都是妖i 提交于 2019-12-07 16:23:24
问题 If an input html element of type=file is used to select a file then that file cannot be deleted by the hta program. This MVCE works but doesn't use the file dialog - you have to type the filename in manually: <html> <HEAD> <SCRIPT Language="VBScript"> Sub Process Set x = CreateObject("Scripting.FileSystemObject") MsgBox "this will actually delete "& INIFile.Value x.DeleteFile INIFile.Value MsgBox "see? "& INIFile.Value &" is gone" Set x = Nothing End Sub </SCRIPT> </HEAD> <body id='body'>

Running an hta above all windows

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 08:58:40
问题 I have an HTML application that I want to stay on top of all windows (that is, if another window is opened/switched to, I want this one to cover it). JavaScript solutions don't work in Windows 7/IE9 Mode (not sure which is holding it back, can't change either), and VBScript solutions seem to either fail outright or depend on outside components. I can't use modal dialogs either because I need this to be on top of ALL other windows, not just its parent. And don't mark this as a duplicate of

how to use vbs variables in html tags

浪子不回头ぞ 提交于 2019-12-06 16:33:39
I'm making an hta app and I'm trying to add in an option to change the color schemes. I've been trying to use a variable in the tag. ex:Color1 instead of black etc.. But everything is just default colors Heres part of what I wrote in the vbs section: Sub changecolor Colorbutton = gray Colorbuttontext = black Colortextbox = black Colortext = aqua End sub Here's a snippit of the HTML I have: <input type="text" color="Colortext"> <input type="button" color="Colorbutton"> I already have a drop down menu that uses onChange="changecolor" and I've tested and I know its getting to the sub I've tried

how to programatically click a button thats loaded from another page?

瘦欲@ 提交于 2019-12-06 16:28:53
<html> <head> <title>My HTML application</title> <HTA:APPLICATION id="frames" border="thin" caption="yes" icon="http://www.google.com/favicon.ico" showintaskbar="yes" singleinstance="yes" sysmenu="yes" navigable="yes" contextmenu="no" innerborder="no" scroll="auto" scrollflat="yes" selection="yes" windowstate="normal" /> </head> <frameset rows="60px, *"> <frame src="topo.htm" name="topo" id="topo" application="yes" /> <frame src="http://localhost/nph-psf.exe?HOSTID=AD&ALIAS=" name="conteudo" id="psyncLink" application="yes" /> </frameset> </html> In my frameset, I have a webpage loading. I can

IFrame event executes fine in HTML but not in HTA

不羁岁月 提交于 2019-12-06 08:10:35
This HTML file shows message dialog when button inside iframe is clicked: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <script language="VBScript" type="text/vbscript"> Sub load_me() frame.document.write "<input type='button' onclick='parent.message()'>" End Sub Sub message() MsgBox "Hi" End Sub </script> </head> <body> <iframe id="frame" onload="load_me"></iframe> </body> </html> While same document as HTA file, raises error: Error: Object doesn't support this property or method : <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>

Is it possible to send HTAREPLY with javascript without window.close()

白昼怎懂夜的黑 提交于 2019-12-06 06:11:34
I am building an HTA/Batch script that includes an interface for a user to send an htareply to the batch script that will send a link to a server to execute a build script on Jenkins. Everything works great but I was wondering if I can leave the hta window open so the user can select another option if required. Any ideas? I attempted to remove the window.close() from the javascript but then it does not send the htareply to the batch script. <!-- :: Batch section @echo off setlocal echo Select an option: for /F "delims=" %%a in ('mshta.exe "%~F0"') do set "HTAreply=%%a" echo End of HTA window,

Using file input element in hta file prevents deleting selected file

淺唱寂寞╮ 提交于 2019-12-05 20:35:23
If an input html element of type=file is used to select a file then that file cannot be deleted by the hta program. This MVCE works but doesn't use the file dialog - you have to type the filename in manually: <html> <HEAD> <SCRIPT Language="VBScript"> Sub Process Set x = CreateObject("Scripting.FileSystemObject") MsgBox "this will actually delete "& INIFile.Value x.DeleteFile INIFile.Value MsgBox "see? "& INIFile.Value &" is gone" Set x = Nothing End Sub </SCRIPT> </HEAD> <body id='body'> <input type="text" name="INIFile" > <input type="button" value="Go!" onClick="Process" > </body> </html>

Executing 32bit and 64bit mshta.exe (bypass default handler)

我只是一个虾纸丫 提交于 2019-12-05 19:24:34
I'd like to be able to launch a page.hta in 32bit and 64bit versions of the mshta.exe. Create the file c:\page.hta <body onclick="if(confirm('Close? (onclick)')){self.close();}"> <h1>Test Page</h1> <script type="text/javascript"> var elem = [ "UserAgent="+window.navigator.userAgent, "Platform="+window.navigator.platform ]; var taBegin = "<textarea style='width:100%' rows='"+((elem.length+1)*1.5)+"'>"; var taEnd = "</textarea>"; document.write(taBegin+elem.join("\n")+taEnd); </script> </body> Now here is the batch file to attemp to load the page differently. @echo off rem Launch 32bit c:

How to get an HTA application to accept command line arguments?

独自空忆成欢 提交于 2019-12-05 16:04:14
Sub Window_onLoad arrCommands = Split(ITTool.commandLine, chr(34)) For i = 3 to (Ubound(arrCommands) - 1) Step 2 MsgBox arrCommands(i) Next End Sub When I run my HTA application, I get: arrCommands is undefined I am trying to make an HTA app that accepts command line arguments (optional). Your script section contains an Option Explicit statement. That makes defining variables before you can use them mandatory. Add a line Dim arrCommands, i to your procedure: Sub Window_onLoad Dim arrCommands, i arrCommands = Split(ITTool.commandLine, chr(34)) For i = 3 to (Ubound(arrCommands) - 1) Step 2

Running an hta above all windows

倖福魔咒の 提交于 2019-12-05 13:45:46
I have an HTML application that I want to stay on top of all windows (that is, if another window is opened/switched to, I want this one to cover it). JavaScript solutions don't work in Windows 7/IE9 Mode (not sure which is holding it back, can't change either), and VBScript solutions seem to either fail outright or depend on outside components. I can't use modal dialogs either because I need this to be on top of ALL other windows, not just its parent. And don't mark this as a duplicate of https://stackoverflow.com/questions/24539339/how-to-open-a-hta-window-on-top-of-all-other-windows because