com >> WSHOM.OCX (Windows Scripting Host)

by Alister Neave » Thu, 17 Nov 2005 07:04:57 GMT

I have code that changes icons on the desktop and startmenu which uses
whsom.ocx ver 5.6.0.8820

In the article http://www.philippursglove.com/VB/binaries/UsingWSH.pdf in
the section 'Differences in Version 5.6', it mentions that this version in
currently in beta, will break code that uses the old declaration of
IWshShell_Class.

My code uses the old declaration, and it works fine but I'm a tad nervous
because this code will be run by 3,000 clients and I don't want to cop an
avalanche of support calls! Maybe in this build Microsoft have adopted the
suggestion to support the old interface, and this change was made after the
article was written. I can't find a date that the article was written, and
can't contact the writer at the email addres given

Can anyone shed light on this?




Similar Threads

1. Create Library For Use in Windows Scripting Host Scripts - VB.Net

2. Can't register Windows Scripting Host with Windows 7

I have a vb6 app. which uses Windows scripting host.
The inno installer has always worked well on Windows 95 through to Vista 
but on Windows 7 produces this error.

C:\Windows\system32\wshom.ocx
unable to register the Dll\OCX: regsvr32 failed with error code 0x5

Any ideas? I've heard the installation of windows scripting host is now 
considered a bad security risk from windows 7 onwards.

3. WSHOM.ocx Documentation and help

4. Windows Script Host in Excel VBA

This is not technically an Excel object, but I'm having a problem with
it within a workbook.  I have some code that calls the
FileSystemObject in a workbook that works fine on my machine, but does
not work on a colleague's machine, which appears to be identical (same
OS, Excel Version 2003).
The code fails on a line like this:
Set fso=New FileSystemObject
or set fso=CreateObject("Scripting.FileSystemObject")
The error is Automation Error The specified module could not be found.
If I go to Tools->References on the problem machine, it doesn't show
any missing referenced files.  Also, if I go to the Object Browser and
search for filesystemobject, it finds it.  Intellisense similarly can
look up the object.  However, I get this error indicating that it
cannot find the FileSystemObject.  What should I try next?

5. Windows Script Host Error - JScript but not VBScript

6. Windows Script Host

Does WSH also  read jscript files besides vbscript?
I understand that it reads .wsf files, too for advanced users.
I am now concerned with vbscripts.



-- 

alan


7. Cannot Retrieve UserName Property in Windows Script Host

8. Exec Method of the Windows Script Host (question)

This script is a subprocedure of a much larger script.  However, the rest of 
the script seems to work, but handle.exe doesn't appear to be redirecting the 
output to the specified output.  I monitored the script through process 
monitor and it appears the command line is being passed to handle.exe 
correctly, but I'm not finding any of the expected files.

Please note the real process names and obj names have been changed for 
privacy reasons.

Set wshShell = WScript.CreateObject ("WSCript.shell")
Set exec1Obj = wshShell.Exec("c:\handle.exe -p process1.exe > 
c:\process1.txt")
Set exec2Obj = wshShell.Exec("c:\handle.exe -p process2.exe > 
c:\process2.txt")
Set exec3Obj = wshShell.Exec("c:\handle.exe -p process3.exe > 
c:\process3.txt")
Const stillRunning = 0
Do While objectsStillRunning = True
IF exec1Obj.Status = stillRunning or exec2Obj.Status = stillRunning or 
exec3Obj.Status = stillRunning Then
Wscript.Sleep 100
objectsStillRunning = "True"
Else
objectsStillRunning = "False"
Exit Do
End IF
Loop
End Sub