I'm looking to execute user supplied scripts from my Delphi application.
Is it possible to host the Windows Script Host engine in my application and supply it with scripts to execute? Or, is there a better way to approach this problem?
P.S I'm not looking for third-party components.
...
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 ajax response:
function(req, event, data) {
globalVariable = true;
}
When I try to loop until the variable is true:
while (globalVaria...
I am not sure whether it has been disscussed before or not but I have the following code (I changed from example for an Access database.)
I don't know what to put inside the 'Provider' and the 'Data Source'. I'm using MS SQL Server 2005 and how to find this information in my machine? Please, even I try to follow from here http://www.c...
Does anyone know how to set the working directory in JavaScript before?
Code I use for launching an application is this:
// Create an object script
oL = new ActiveXObject("WScript.Shell");
oFile = '"C:/Application.exe"';
oL.run(oFile);
...
When a .vbs script is run from the command line, it will by default show a Microsoft header:
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
How can this be disabled?
...
I'm writing a JScript program which is run in cscript.exe. Is it possible to run a commnad line command from within the script. It would really make the job easy, as I can run certain commands instead of writing more code in jscript to do the same thing.
For example:
In order to wait for a keypress for 10 seconds, I could straight awa...
I have a working C# COM component dll, with a class called MyComponent in the ap namespace, which is added to the GAC and registered successfully. I added a Add() call to it, tested it with a win32 c++ exe and called the Add() call successfully, so its all working.
However I want to test the call in WSF (windows script) I put the code b...
I want to automate simulation of a right click to open the context menu. Once the menu is open, select the selected action/shortcut available.
I know how to open:
WshShell.SendKeys("+{F10}");
Or using the AutoIt automation language (BASIC like):
;--on right click event
MouseClick("right")
$count = 1
Do
Send("{D...
I am trying to write a WSH logon script. Administrators throughout the company need to be able to customize the execution of the script, and execute additional scripts, for specific locations and users. In order to make their jobs easier, I would like to provide an API that the administrators can access in their scripts. If I write my AP...
I am looking for a way to launch multiple scripts in a separate process from my main script, but in such a way that they can access copies of variables I've declared. Consider the following example:
Serializable.js:
// Represents serializable data.
function Serializable() { /* ... */ }
SecondaryScript.wsf
// Serializable is not defi...
While trying to port and generally playing around with some non-browser code, I came across getters and setters that looked like normal object properties. Something like this:
js> var o = {
a: 4,
get b(){
return this.a + 3;
},
set b(val){
this.a = val - 3;
}
};
js> o.a
4
js> o.b
7
js> o.b=10
10
js> o....
Is there a way to get access to a window handle in windows using WSH, or WMI or similar? I just want to flag a window as always-on-top. Ideally I'd use windows script host for this.
Please note, I don't want to install PowerShell on the system in question. We are nervous about any additional software and already have some VBS files inv...
Background:
I have a JScript that runs when the computer starts up (from task scheduler). The script does some magic and determines if a user should be allowed to login at all. It starts by disabling all user accounts and then if a user is to be allowed in it enables the users account by firing the 'net user' command using wshShell.Exec(...
Im trying to get my feet wet with some WSH. I thought it was going to be easy, but it's really a nightmare...
contents of registry.js >
Set shell = WScript.CreateObject('WScript.Shell');
strRegValue = 'HKLM/Software/Microsoft/Windows/CurrentVersion/ProductID';
strPID = shell.RegRead(strRegValue);
WScript.Echo strPID;
This is ...
I'm trying to use WSH in place of DOS/Batch files.
Thanks for the input!
...
I want to iterate over the environment keys and print a list of these items.
...
I have created a custom rightclick menu element in IE8 using the following registry info:
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\WebOn edit]
@="c:\\webon_edit\\wo_edit.vbs"
The choice "WebOn edit" shows up in IE8's rightclick menu. Before upgrading to Windows 7, this worked fine: When I clicked the menu choice...
I wrote the following two functions, and call the second ("callAndWait") from JavaScript running inside Windows Script Host. My overall intent is to call one command line program from another. That is, I'm running the initial scripting using cscript, and then trying to run something else (Ant) from that script.
function readAllFromAny...
Hello,
I have the following code in a script.
The problem is That I want to get information of scripts that starts in a specific name and are in a specific startmode.
var e = new Enumerator(GetObject("winmgmts:").InstancesOf("Win32_Service"))
var WSHShell = new ActiveXObject ("WScript.Shell");
var strPrefix = "TTTT";
for(;!e.atEnd(...
When I try to run the following code in my program
setTimeout("alert('moo')", 1000);
I get the following error
Error: Object expected
Code: 800A138F
Source: Microsoft JScript runtime error
Why? Am I calling the wrong function? What I want to do is delay the execution of the subsequent function.
...