wsh

Change Console Title with vbscript

Hello, is there a way to change the cmd title? I wrote a vbs program. But the dos title is bad. The name ist c:\windows\system32\cscript.exe I try it with: title the_name and title ="name" But both doesn't works. Thanks for help. ...

Ping script with email in vbs

Hello, i know i asked already the question about the ping script but now i have a new question about it :-) I hope someone can help me again. strText = "here comes the mail message" strFile = "test.log" PingForever strHost, strFile Sub PingForever(strHost, outputfile) Dim Output, Shell, strCommand, ReturnCode Set Output = C...

How to reference a JScript file from another one?

I am writing some server-side scripts using JScript and WSH. The scripts are getting quite long, and some common functions and variables would fit better in a general library script which I included in my various script instances. But, I cannot find a way reference one JScript file from another. For a moment, I though reading the file c...

read out a txt and send the last line to email adress - vbscript

Hallo, I'm back haha :-) so i have the next question and i hope someone can help me... I know i have a lot of questions but i will try to learn vbscript :-) Situation: This script read out (every 5 min) the last line of a txt and send it to my eMail Address. Problem: I'll check the txt all 5 min, but at the moment every 5 min there co...

Esoteric JScript hosting problem: where is the error code when IDispatch::Invoke returns SCRIPT_E_PROPAGATE?

Our application hosts the Windows Scripting Host JScript engine and exposes several domain objects that can be called from script code. One of the domain objects is a COM component that implements IDispatch (actually, IDispatchEx) and which has a method that takes a script-function as a call-back parameter (an IDispatch* as a parameter)...

how do you include an external script using javascript in windows script host cscript.exe

how do you include an external script using javascript in windows script host cscript.exe ...

WSH 5.7's shell.Run executes wrong Scripting Host engine?

I use a WSC (a COM server written in JScript and run with scrobj.dll) that starts also other script files using shell.Run("TheOtherScript.js"); The WSC server is instantiated with new ActiveXObject(PROGID). Until WSH 5.6 I could set the execution engine for shell.Run with the command WScript //H:CScript or with //H:WScript to get the...

VBScript to search two Strings in a TXT

Hello, i try to make a VBScript that read a txt and search for two strings and gives out only the last results. String 1: Hello123 String 2: Test123 The TXT looks like this: 27.07.2010 09:45 ... DumDumDum ... 27.07.2010 09:45 ... BlaBlaBla ... 27.07.2010 09:45 ... Hello123 ... 27.07.2010 09:45 ... BlaBlaBla ... 27.07.2010 09:45 ...

Shutdown Hook with windows-scripting-host

Hi, The following link (http://www.bigresource.com/Tracker/Track-vb-MjQNB6lXIl/) discusses how a shutdown hook can be implemented using VB. Now my question is, can something like that be done using Windows Script Host/windows scripting host ? I would very much appreciate your input; maybe include some code snippets. Thanks, Klaus. ...

jscript+wsh can't launch notepad.exe, vbscript+wsh can. Why?

Never mind, I solved it. It should just be <a href="#" onclick="runnp()">Run notepad.exe</a> Original question: I'm trying to write a webpage that will launch programs on my local computer. How come only the vbscript version works? Nothing happens when I click the jscript link. <html> <head> <script language="VBScript"> Sub ...

Unregistering or removing or undoing global Hotkey setting leftover from testing jscript in wsh

Below is some jscript code that I modified from the example code at http://msdn.microsoft.com/en-us/library/aew9yb99%28v=VS.85%29.aspx : // Code snippet to create a desktop link: var WshShell = WScript.CreateObject("WScript.Shell"); strDesktop = WshShell.SpecialFolders("Desktop"); var oShellLink = WshShell.CreateShortcut(strDesktop + "\...

how to read (Default) value in Registry Key in VBScript/JScript

Hi I can read the value of the key name "UpdateCheck" under HKEY_LOCAL_MACHINE\SOFTWARE\CCleaner\ with Shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\CCleaner\UpdateCheck") But I cannot read that of the key name "(Default)" . Shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\CCleaner\Default") How to read it? ...

How to convert an image file to BMP programmatically using native Windows XP capabilities?

Is it possible to convert an image file to BMP format using WindowsXP's native libraries and scripting capabilities? I'm talking about WSH, JScript, VBS, etc... C++ is also good for what I need if it can be compiled with Dev-C++ ...

How to get the main window handle of a process using JScript?

Is there any method in JScript to get the handle of the main window of a process by providing the process name? The Process.MainWindowHandle property works only in JScript .NET. Is anything similar available in classic JScript? ...

WSH - List Available Functions

I would be interested to know if there is any way for a script to obtain a list of available methods/functions within a Windows Script Host (VBScript) being hosted by some parent application? If it was a .NET app, it would be using reflection, but I'm not sure if there is anything similar for WSH. ...

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, 124); // set x, y, width and height window = FindWindow("Windows Live Messenger"); window.setPos(1140, 0, 900, 124); // etc... I suspe...

WSH / JScript to start and stop services based on time?

Hi all, Just looking to see if my assessment is correct on the easiest way to do this. Background: we have a software suite which we're running via services. The services need to be shut down between 10pm and 6am. We also need to check every 10 min to recover the services in case they've gone down when they were supposed to be up, and...

Windows Script Host & Quick Fix Engineering

Hello! I want to get list of installed windows hotfix and updates. I use script below: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colQuickFixes = objWMIService.ExecQuery _ ("Select * from Win32_QuickFixEngineering") Set objDateTime = CreateOb...

Windows Script Host & Quick Fix Engineering

Hello! I want to get list of installed updates on Vista Business using WSH Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set colQuickFixes = objWMIService.ExecQuery("Select * from Win32_QuickFixEngineering") Set objDateTime = CreateObject("WbemScripting.SWbemDateTime") For Each objQuickFix in...