All Questions
31
questions
1
vote
1
answer
343
views
Am I able to embed HTA code into VBScript? [duplicate]
EDITED
My company used VBScript and IE to create popups for gathering and displaying information. Now that IE is going away, we can't do this in Edge. We're looking for a way to use HTA embedded in ...
2
votes
2
answers
329
views
Getting a response from a wsh script
In my HTA app there are some actions which are executing some heavily time-consuming tasks on a server. For example an action uses an old ActiveX component to read some fileproperties (like Subject ...
2
votes
1
answer
2k
views
CreateObject("WScript.Shell").Run Path with spaces can not find file
I am receiving a error when running a WScript.Shell Run with a path that has a spaces in it.
I've tried several different variations that result in the same error.
CreateObject("WScript.Shell").Run "...
2
votes
1
answer
1k
views
How to get CMD output in HTA file within JavaScript
I run some CMD commands in my HTA file like
<script>
var WShell = new ActiveXObject('WScript.Shell');
WShell.run('cmd /c the_first_command');
WShell.run('cmd /c the_second_command');
</...
1
vote
1
answer
2k
views
How to run CMD commands one by one in HTA
I'm trying to run in my HTA file the following Win CMD commands one by one
<script>
var WShell = new ActiveXObject('WScript.Shell');
WShell.run('cmd /c "cd C:\\Users\\Username\\myFolder &&...
2
votes
2
answers
796
views
How to display a message when opening HTA file with VBS
I have VBS file with the only line
CreateObject("Wscript.Shell").Run "cmd /c start mshta.exe %cd%/app.hta",0,True
When I click this VBS file, there is a delay before the HTA file is opened, so I ...
1
vote
4
answers
2k
views
Use WScript.Sleep() or replacement in mshta.exe one-liner
I want to use WScript.Sleep() function with a mshta.exe one-liner from a batch (I don't want to write temporary files) but I receive a WScript undefined error.
As stated in this answer:
WScript is ...
0
votes
0
answers
779
views
How to convert a string from a file to an object with JS in .HTA without JSON.parse
I have a .HTA file with JS like this:
<script>
var fso = new ActiveXObject('Scripting.FileSystemObject');
var configsHandle = fso.OpenTextFile('configs.json', 1);
var configs = configsHandle....
0
votes
2
answers
502
views
Can't set a new innerHTML for an element with JS in .HTA page
I'm trying to set a new innerHTML property for the head element of my .HTA page for example:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Some title</...
3
votes
1
answer
7k
views
Define and call Wscript function inside Javascript file to run in Windows Script Host
I need exactly like I asked in question title.
I have a javascript file for calculating Thanksgiving date for every year, provided the year value input.
Now I want this javascript to be executable ...
3
votes
3
answers
3k
views
How to minimize window?
How to minimize window?
I am making HTA application and I want replace window title bar with my custom one.
I've disabled it by HTA's "caption=no" option and placed my own minimize/maximize/close ...
2
votes
1
answer
385
views
bWaitOnReturn has no effect on mstsc.exe when run from HTA
In VBScript, the WScript.Shell.Run method has three arguments, the third of which is a boolean value specifying whether the program should wait for a newly-spawned process to finish before proceeding.
...
1
vote
1
answer
125
views
Trouble getting WScript.Shell to work from HTA page
I have a private HTA application that I want to launch bat files and regular cmd functions (cd, delete, etc.) from.
My script follows:
<script type="text/javascript">
var SHELL = new ...
1
vote
1
answer
1k
views
WScript to run exe from client PC without any popup windows, silently
My objective is to launch an .exe from client PC, from Internet Explorer, without any user interaction needed. I'm deploying in a sandbox environment so the security is not of my concern here.
I've ...
4
votes
2
answers
5k
views
Make an HTA file run as admin (elevated)
In wsf, vbs and js files you can easily find out if they run elevated and if not you can easily make them.
The code I've written for that is this:
EnsureElevatedPrivileges();
WScript.Echo("Running ...