hta

VBScript with HTA frontend

拈花ヽ惹草 提交于 2019-12-13 09:53:31
问题 OK, I have a nifty VBS that will search huge log files for certain character strings, but I don't always want to search every log file for every string. I'd like an HTA frontend that allows the end user to select what strings they want to look for. Here is a sample of my code and it works great as a vb, but in this example, i'd like checkboxes for cows, goats, cats, dogs, etc.. and for the script to run correctly no matter how many are selected.. (my actual script has about 20 words to choose

How to obtain last three lines content of a log file using VBScript function

若如初见. 提交于 2019-12-13 09:04:23
问题 Can anyone suggest me a VBscript function to get the last 3 lines of a text document (for eg: log.txt ? Below is my code which can fetch and display the entire log on my screen but I want to get only last 3 lines of the log file named log.txt. <script type="text/Vbscript"> Option Explicit Dim File File = "C:\\test.txt" '*********************************************************** Sub LoadMyFile() myDiv.innerHTML = LoadFile(File) End Sub '********************************************************

IE post to iframe in HTA opens a new window

≡放荡痞女 提交于 2019-12-13 04:28:34
问题 There are a lot of posts about this topic but most of them are because IE doesn't set the attribute name dynamically. I'm having a different trouble: I post a form (created dynamically) with an iframe as target . The first time it works great. Then I do it for a second time and IE opens a new window with the result of form's submission. I'm pretty sure it has to do with security issues because: if I create a simple HTML file (instead of a HTA ) it works great. Also, if I run the same file

VBScript set value at onload

别说谁变了你拦得住时间么 提交于 2019-12-13 02:25:04
问题 I have an HTA with VBScript that has an element set to a variable, SN2: <script language="VBScript">document.getElementById("ComputerName").value = SN2</script> Set to print out to an HTML textbox: <html><input class="inputs" type=text id="ComputerName" name=ComputerName /></html> And this works well! However, I wanted to set the value to display in the textbox on onload To do this, I set my VBScript function to <body onload="myFunction()"> . And this works well, except there is another

Is it possible to peform a Windows Explorer search using JavaScript for a HTA?

隐身守侯 提交于 2019-12-13 01:25:41
问题 This is the code that I have been working on that doesn't work. I want it to perform the search and look into a folder called "info" in the same directory. <html> <head> <title>Application Executer</title> <HTA:APPLICATION ID="oMyApp" APPLICATIONNAME="Application Executer" WINDOWSTATE="normal"> <script type="text/javascript" language="javascript"> function RunFile() { WshShell = new ActiveXObject("WScript.Shell"); WshShell.Run("explorer.exe search-ms://query=somethinginapdf", 1, false); } <

Javascript - getting path of file dropped into HTA

和自甴很熟 提交于 2019-12-12 08:16:39
问题 I am building a little HTA for personal use, and would like to be able to drag and drop a file to the interface. Once the file is dropped, I would either automatically run it (assuming it fits some parameters I set, like file extension), or at least fill in the input box on the HTA interface. I've searched extensively, but can't find a solution. Thoughts? 回答1: An HTA obviously cannot be target of a shell drop operation – at least on my system, dropping something on an HTA is impossible. This

Input Correction Using Vbscript

我是研究僧i 提交于 2019-12-12 05:35:23
问题 My Hta add bookmark using vbscript. when user type Web address like http://www.Google.com/ it works well but when user type www.Google.com only,it add a button but this time button doesn't work and ended up showing an error of invalid address. code -- <HTML xmlns:IE> <HEAD> <TITLE>Bookmarks</TITLE> <HTA:APPLICATION ID="appbook" VERSION="1.0" APPLICATIONNAME="Bookmarks" SYSMENU="yes" MAXIMIZEBUTTON="Yes" MINIMIZEBUTTON="yes" BORDER="thin" ICON="img\img.icoh" INNERBORDER="thin" SCROLL="Yes"

Generating table

痞子三分冷 提交于 2019-12-12 04:08:05
问题 I am trying to push my output from VBScript code in table row and table cell. My code is: Set table = document.CreateElement("table") i = 0 For Each node In objMSXML.selectNodes(sXPath) Set tr = document.createElement("tr") Set td = document.createElement("td") For Each element In node td.innerText = element.parentNode.nodeName & "->" & element.text tr.appendChild td Next table.appendChild tr ObjOutFile.WriteLine node.parentNode.nodeName & "->" & node.text i = i + 1 Next document.body

Keeping an HTA from resizing to extremely small sizes

会有一股神秘感。 提交于 2019-12-12 03:26:04
问题 I have a HTA that I want to block resizing to extremely small sizes (less than 170x70). I found a way in VBScript to do this by detecting if the window is to small and if it is resizing it automatically like this: <script type="text/vbscript"> Sub Window_onResize Dim w Dim h Dim p w = Document.Body.OffsetWidth h = Document.Body.OffsetHeight p = false If Document.Body.OffsetWidth < 170 Then w = 170 p = true End If If Document.Body.OffsetHeight < 70 Then h = 70 p = true End If If p Then window

How do you extract data from vendor website in vbscript?

﹥>﹥吖頭↗ 提交于 2019-12-12 03:09:01
问题 I have programmed a post image HTA which is launched after an XP image has been loaded onto a computer. The HTA gathers information from the user (ie primary user name, department, etc) and updates the registry under a custom key. Management has asked if I can pull the computer's warranty information (specifically the warranty end date) from the vendor's website (in this case Lenovo) and update the registry with this info. Lenovo allows anonymous lookup using computer type and serial number