Re: Script hangs, but only one one machine
- From: Jakob Bohm <jb@xxxxxxxxxx>
- Date: Mon, 23 Jul 2007 17:40:54 +0200
deetony wrote:
We have a Server W2k3 SP1 with WSH 5.6.Both of these operations (changing the system default for an
The following test-script hangs for around 15 second at two steps.
Here the test script:
--------------------------------------------------
msgbox("scriptstart")
set objWSHShell = WScript.CreateObject("WScript.Shell")
msgbox("Setze Umgebungsvariable...")
setdbimpvar(0)
msgbox("fertig.")
msgbox("Starte Anwendung (winword)...")
Set objWord = WScript.CreateObject("Word.Application")
set objword = nothing
msgbox("fertig.")
msgbox("Starte wscript.network zum Setzen des Standarddruckers")
Set wshnet = CreateObject("WScript.Network")
wshnet.SetDefaultPrinter "Serviceprinter"
Set wshnet=nothing
msgbox("fertig.")
wscript.quit
Function setdbimpvar(myzahl)
Set WshEnv = objWSHShell.Environment("System")
WshEnv("dbimp") = myzahl
If err.number<>0 Then
err.clear
On Error Resume next
End If
Set WshEnv=nothing
End Function
------------------------------------------------
The script hangs around 15 seconds after "Setze Umgebungsvariable" and another 15 seconds after "Starte wscript.network zum Setzen des Standarddruckers"
The funny thing about it is, that this sript hangs only on this specific machine. On any other it runs fast, so it may not be a matter of the script. We reinstalled WSH 5.6 but it didn't solve the problem. All file versions are up to date.
Does anyone has any idea or suggestion ?
environment variable and changing the default printer) causes
a notification to be sent to each top level window on the machine, so other programs can adapt to the change immediately.
If some other program on that one machine is not processing messages
"in a timely manner" (even if that program has not asked for the notification), your script hangs until the notification times out.
Some Microsoft tools (including the first tab of Task Manager) will label the slow-eating program as "not responding", which may help you find it.
Writing programs to eat unwanted notifications all the time no matter what the program itself is really doing is actually very difficult and thus something not always done.
--
Jakob Bøhm, M.Sc.Eng. * jb@xxxxxxxxxx * direct tel:+45-45-90-25-33
Danware Data A/S * Bregnerodvej 127 * DK-3460 Birkerod * DENMARK
http://www.netop.com * tel:+45-45-90-25-25 * fax:+45-45-90-25-26
Information in this mail is hasty, not binding and may not be right.
Information in this posting may not be the official position of Danware
Data A/S, only the personal opinions of the author.
.
- Prev by Date: RE: Retrieving Custom Document Props from closed PPT presentation
- Next by Date: Re: Rundll32 printui.dll problem
- Previous by thread: RE: Retrieving Custom Document Props from closed PPT presentation
- Next by thread: Hey, this is beautiful ! I need to share my belief
- Index(es):
Relevant Pages
|