Questions tagged [wsh]
For questions relating to Windows Script Host (WSH), a language-independent scripting host for the Windows operating system. It allows scripts to be run from both the graphical Windows desktop (via WScript.exe) and the command prompt (via CScript.exe).
302
questions with no upvoted or accepted answers
6
votes
0
answers
438
views
WSO2 WSF PHP - WSClientProxy->__call not returning big response
I've been trying to consume a service using WSClient in WSDL mode, but the response is always a array with an empty string.
I'm using WSO2 WSF for PHP(WSO2 Web Services Framework for PHP) and my PHP ...
5
votes
0
answers
4k
views
Get target of Windows .lnk shortcut using "Start in" directory
I am trying to retrieve the target path of a Windows .lnk shortcut, but the "Target" is not an actual file path according to the .lnk file's properties:
I am using the IWshRuntimeLibrary and the ...
5
votes
2
answers
2k
views
Get line number of an error in JScript run in Windows Script Host
Say, I have the following code that I run as a .JS file using the Windows Script Host:
try
{
ProduceAnError();
}
catch(e)
{
//How to get an error line here?
}
Is there any way to know the ...
4
votes
1
answer
3k
views
Cscript. How to make a multi-colored text
I'm trying to get a multi-colored text to the console using Cscript.
WScript.Echo('\033[31m' + 'Some Text' + '\033[0m');
This solution does not work. Is there any way to get the multi-colored text ...
4
votes
0
answers
1k
views
What is the difference between creating a COM instance through CreateObject versus ActiveXObject?
This has been touched on here in the second answer but I don't see how it answers the question (nor does the link provided).
What can ActiveXObject do that CreateObject cannot, and vice-versa?
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
4
answers
3k
views
How to check default host for VBScript is WScript or CScript?
I would like to know what is default host for VBScript on particular machine, whether that is set to WScript or CScript ? For example, if I use cscript //h:cscript //s then is there any way I can ...
3
votes
1
answer
4k
views
How to send a keystroke to an application remotely with Powershell
I need to close an open application windows with a keystroke "q" via Powershell.
I found a solution here on stackoverflow (How to perform keystroke inside powershell?) which works perfectly fine but ...
3
votes
2
answers
2k
views
Get a line number from exception in JScript
I'm running the following code in Windows Script Host (not web browser.) Is there a way to get the line number where exception occurred?
try
{
//Exception happens here
}
catch (e)
{
//Get ...
3
votes
0
answers
361
views
Read Message from Error Message Dialog Box using WScript
Problem Definition : Write wscript to click "OK" button of a Error Message DialogBox and get/read what the Error message is given in the DialogBox.
Error Message is generated from validation of Excel ...
3
votes
1
answer
800
views
How do you split a 64bit number into high 32 bits and low 32 bits in VBScript?
I've got a 64 bit number in VBScript (WScript) that I want to divide into 32 bit high part and low part. The number is represented as a string (in base 10). The largest supported primitive is a 53 bit ...
3
votes
3
answers
761
views
How to write a script for organizing my desktop windows? (WinXP)
I would like to write a script that moves the currently open Windows to a certain location.
Ideally, my program would look like this:
var window = FindWindow("Winamp");
window.setPos(1140, 900, 160, ...
3
votes
1
answer
2k
views
JScript Wait function
I have a function written in JScript (Not javascript) I need to suspend until a certain global variable becomes true.
The global variable is changed to true when another function is called after an ...
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
0
answers
73
views
How to access UDP from Javascript running in WSH?
I am trying to access udp NOT from a browser but running from wscript. I see various solutions that depend on System.Net and System.Net.Sockets but none of them work. They all fail when I try to ...