August
Sun Mon Tue Wed Thu Fri Sat
   
18
   
2006
Months
Aug
BlogTools
the possibly accurate now

Fri, 18 Aug 2006

[09:24] Bug? WScript and CScript execute Shell.Run differently.
I've been trying to debug something this afternoon and I've just realised that the reason it's not working is because the two Windows Scripting Host engines, WScript and CScript (possibly the W and C stand for Windows and Command-Line respectively) treat the Shell.Run method differently!

To see the bug in action, create a .vbs file with the following content (which comes from the page linked above): Set WshShell = WScript.CreateObject("WScript.Shell") Return = WshShell.Run("notepad " & WScript.ScriptFullName, 1, true) You can specify the engine to use on the command line. Run "CScript.exe test.vbs" or "WScript.exe test.vbs" to see each in action.
When run, this should execute the notepad program and then wait for the process to terminate before exiting. Under the CScript engine this is exactly what happens. When the WScript engine is used the script terminates as soon as the notepad proces has been spawned.

I've not found a KB article acknowledging this just yet but I can confirm that this happens on Windows XP (Version 5.1.2600) using WSH 5.6 8515 and Windows 2003 Server Standard (Version 5.2.3790) using WSH 5.6 6626.

[Posted at: 18/08/2006 17:24]

Updated 23/08/2006 20:48: I raised a bug, or as Microsoft calles them "Feedback Item", specifically Feedback ID 182672, mostly because I wanted to try out the Microsoft bug tracking facility: connect.microsoft.com. It was actually pretty easy to find and use, I'll be interested to see if anyone actually picks the bug up or not though...


category: /tech | permalink | Comments suspended due to spamwhores


[09:00] This Space Intentionally Left Blank
Holy crap! Life got REAL busy all of a sudden. I've not stopped writing entries but they're all archived on my USB key pending some photos being sorted out. Hopefully I'll get life sorted out somewhere in the next couple of weeks and I'll remedy the drastic post shortage. Just wanted to let y'all know I wasn't dead!

[Posted at: 18/08/2006 17:00]


category: /life | permalink | Comments suspended due to spamwhores