hta

HTA (Html Application) VBScript Reading Textfile line and colouring that line only

假装没事ソ 提交于 2019-12-23 01:54:56
问题 I have been working on a Chat HTA file to play with at work... :) It works pretty good, but someone asked to colour each person text a different colour ? I have been trying to get it but im having trouble, can someone help me out if possible ? below is the basic code for what i have done\found i got as far as putting each line into a array but then to assign a colour to each line i cant work out... OR if i cant display the "chat" in the windows with out the use of a text file then that would

How do you pass a javascript variable as an argument to a vbscript function (in the context of HTAs)?

∥☆過路亽.° 提交于 2019-12-20 03:17:16
问题 I am writing an HTA and I need to pass a variable that I have in Javascript to a VBScript function. Can you please let me know how to do this? Here is a (nonworking) example of what I'm trying to do: <!DOCTYPE ... > <html> <head> <HTA:APPLICATION ID="chrome" APPLICATIONNAME="kiosk" ... /> ... <script type="text/javascript"> ... var closer = "C:\Program Files"; ... </script> <script language="VBScript" src="close.vbs"></script> </head> <body> <a href="#" onClick="VBScript:CloseExplorerWindow

HTA VBScript and CSS3+HTML5. Code not running correctly when <meta> for css3 applied

若如初见. 提交于 2019-12-19 10:33:33
问题 I have a problem applying CSS3 and pretty round buttons to my HTA app. As soon as I enable <meta http-equiv="x-ua-compatible" content="ie=9"> tag to turn CSS3 on the code goes straight to hell. Counting doesn't work right and it looks like it operates on a copy of values from arrays arrX . I tested it with msgbox and once clicked it counts right but then goes back to 0 . When I remove meta tag and parenthesis in last two subs sub SaveData() and sub ExitWindow() and remove parenthesis from all

HTA & Batch Hybrid, passing variables from BATCH section

廉价感情. 提交于 2019-12-19 08:39:33
问题 I'm attempting to write a batch + hta hybrid script that will allow me to pass variables from the batch section of the script to the hta section, so that way I can generate things like the computers model number etc. This is what I have so far - Batch: <!-- :: Batch section @echo off Pushd "%~dp0" setlocal FOR /F "tokens=2 delims='='" %%A in ('wmic ComputerSystem Get Model /value') do SET model=%%A for /F "delims=" %%a in ('mshta.exe "%~F0" "%model%"') do set "HTAreply=%%a" echo End of HTA

Security Level for WebBrowser control

不打扰是莪最后的温柔 提交于 2019-12-19 03:09:48
问题 I am trying to migrate an .hta application to a C# executable. Of course, since it's an .hta the code is all HTML and Jscript , with calls to local ActiveX objects. I created a C# executable project and am just using the WebBrowser control to display the HTML content. Simply renamed the .hta to an .html and took out the HTA declarations. Everything works great, except that when I make calls to the ActiveX objects, I get a security popup warning of running an ActiveX control on the page. I

Vbscript Wscript.Run method stuck because of space character

荒凉一梦 提交于 2019-12-18 09:47:59
问题 Error System can't find the file specified strCline = Document.getElementById("head").innerHtml msgbox strCline strCline = replace(strCline, " ",Chr(32)) oShell.run strCline Set oShell = Nothing Above code produces error because it can't read file name properly. It's all because of space characters in file name. After reading, i found chr(32) would replace space character but it won't. How do I make it take space character. Edit: My final code looked like this which worked. I made mistake

I need to force a click within a hta script

断了今生、忘了曾经 提交于 2019-12-14 04:14:43
问题 I'm a good scripter, but not a developer. Can someone please advise how to force a click event to this line of code, or to force the "installergui_startinstallation" routine to kick off automatically. Thanks. Here is the line that takes the click command: <button id=butStartInstallation onClick="InstallerGUI_startInstallation">Install</button>     <button id=butCancel onClick="self.close()">Cancel</button> 回答1: So I am a Javascript man, and it looks like in HTA you can have a <script type=

How to Store Hta/Html File in Project Resources and Use in Program

点点圈 提交于 2019-12-13 21:18:44
问题 I have added an .hta file to my applciation's resources like so: And I would like to display this by using the line: Process.Start("explorer.exe", @"Path\To\File.hta"); This works when the file is on my system, but when I try displaying the .hta with: Process.Start("explorer.exe", Properties.Resources.htatest); I see this error: There is no program associated to perform the requested action. Please install a program or, if one is already installed, create an association in the Default

Reading a local text file in JavaScript

元气小坏坏 提交于 2019-12-13 16:49:45
问题 I just started learning JavaScript and I have a small problem. I have a text file with some text in it. I can read the content of the text file in browser (I mean in .hta) but the text appears as a single line. I want to add line breaks to each line. How do I do that? Text file content: I want to live where soul meets body And let the sun wrap its arms around me ... JS: var fso = new ActiveXObject("Scripting.FileSystemObject"); var txtFile = fso.OpenTextFile("C:\\myJS\\test.txt", 1, false, 0)

vbscript statement mismatch string failing [duplicate]

帅比萌擦擦* 提交于 2019-12-13 10:51:52
问题 This question already has an answer here : Password notification script raising “type mismatch” error for remaining number of days (1 answer) Closed 3 years ago . I am running the script listed in the link below. PwExpChk.vbs can I add a company logo? I have substituted the Msgbox with the following: if (daysLeft < warningDays) and (daysLeft > -1) then strCMD = "\\domain\netlogon\PwExpChk\PWReminder.hta" -13 Set wshShell = CreateObject("Wscript.Shell") RC = WshShell.run(strCMD , 0, False) End