Basic WshShell.Exec problem 
Author Message
 Basic WshShell.Exec problem

Here's your daft question of the day ...

Why do I get the VBScript error "Object doesn't support this property or
method: 'Exec'" (Code 800A01B6) when I run a VBScript with the following
first few lines:

Dim oShell, oExec
Set oShell = WScript.CreateObject("WScript.Shell")
Set oExec = oShell.Exec("ftp")

Obviously it's happening on line 3.

Is it that the Exec method was added quite recently and I'm using an old
version of wscript?

Many thanks

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Tue, 24 Aug 2004 20:07:30 GMT  
 Basic WshShell.Exec problem

Quote:

> Is it that the Exec method was added quite recently and I'm using an old
> version of wscript?

Yes, that must be it. The Exec method came with the latest WSH (5.6)

Go to
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?co...

to download WSH 5.6

--
torgeir



Tue, 24 Aug 2004 20:15:28 GMT  
 Basic WshShell.Exec problem
Not so daft, particularly since you basically answered yourself.  It works fine on my system.
Here's a quick VBScript to check your version (you want 5.6):

--
 ws = ScriptEngine & " Version " _
 & ScriptEngineMajorVersion & "." _
 & ScriptEngineMinorVersion _
 & "." & ScriptEngineBuildVersion
wscript.echo ws

You can download it from this page - watch for URL wrap, and make SURE you pick the right version for your OS - 9x and 2000 use
different versions!

http://msdn.microsoft.com/downloads/default.asp?url=/downloads/topic....

: Here's your daft question of the day ...
:
: Why do I get the VBScript error "Object doesn't support this property or
: method: 'Exec'" (Code 800A01B6) when I run a VBScript with the following
: first few lines:
:
: Dim oShell, oExec
: Set oShell = WScript.CreateObject("WScript.Shell")
: Set oExec = oShell.Exec("ftp")
:
: Obviously it's happening on line 3.
:
: Is it that the Exec method was added quite recently and I'm using an old
: version of wscript?
:
: Many thanks
:
:
:
:
: *** Sent via Developersdex http://www.developersdex.com ***
: Don't just participate in USENET...get rewarded for it!



Tue, 24 Aug 2004 20:30:37 GMT  
 Basic WshShell.Exec problem

Quote:

> Yes, I've found a PC lying around here and upgraded it to 5.6. You won't
> be surprised to hear that everything works OK.

No ;-)

Quote:
> My problem now is to persuade our server management people to do the
> same to the Citrix server that I have to use under normal conditions.
> That might prove quite difficult but I'll give it a go.

I guess the Citrix servers already has some (old) version of WSH already
installed (e.g it comes default installed with W2k/WXP, and with Internet
Explorer as well)? There has been several security updates to WSH the last
couple of years, so seen from a security point, they should absolutely upgrade
to the newest version anyway!

That should include this one:
MS02-009: Incorrect VBScript Handling in Internet Explorer Can Allow Web Pages
to Read Local Files (Q318089)
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318089

Note the MS KB Q318089 mention vbscript.dll version 5.6.0.7302 (which has a bug
in it!), but the *ENGLISH* version to download gives you version 5.6.0.7426 that
has the bug fixed!

--
torgeir



Wed, 25 Aug 2004 00:25:13 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. WshShell.Run vs WshShell.Exec

2. runas with WshShell.Exec versus WshShell.Run

3. How to wait for termination of program started with WshShell.Exec

4. using WshShell.Exec

5. - WSHSHELL.EXEC error in ASP Web Page

6. WshShell.Exec Passing Invalid Argument to CL App

7. WshShell.Exec what is wrong?

8. WSH 5.6 WshShell.Exec - Minimized Window?

9. WshShell.Exec: reaping return codes and waiting for termination

10. q: asynch piping of WshShell.Exec.StdOut

11. WshShell.Exec without command prompt window?

12. q: asynch piping of WshShell.Exec.StdOut

 

 
Powered by phpBB® Forum Software