borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (DateFormat in C#?)Next Topic (Error: ATL Server Debugging) New Topic New Poll Post Reply
AndreaVB Forum : ASP.Net : Help with WScript
Poster Message
MattA
Level: Whizz Kid

Registered: 13-08-2003
Posts: 15

icon Help with WScript

I am trying to use the WScript Object model to create .lnk files and to open applications on the client side.
I have tried using javascript and vbscript e.g

var shell = new ActiveXObject( "WScript.Shell" );

but I get an error "Microsoft JScript runtime error: Automation server can't create object"

Any help would be gratefully received

Thanks

Matt

04-01-2005 at 03:43 PM
View Profile Send Email to User Show All Posts | Quote Reply
humberto
Level: VB Lord

Registered: 13-01-2005
Posts: 246
icon Re: Help with WScript

what about

Set Shell = CreateObject("WScript.Shell")
objWShell.CurrentDirectory = "C:\yourdir\"

29-01-2005 at 01:27 AM
View Profile Send Email to User Show All Posts | Quote Reply
MattA
Level: Whizz Kid

Registered: 13-08-2003
Posts: 15
icon Re: Help with WScript

I sorted it out in the end. I guess I should have replied to my own post.

Thanks anyway


function RunFileInClient(myFile)
{
var WshShell = new ActiveXObject("WScript.Shell");
var oExec = WshShell.Exec(myFile);
}

31-01-2005 at 08:40 AM
View Profile Send Email to User Show All Posts | Quote Reply
humberto
Level: VB Lord

Registered: 13-01-2005
Posts: 246
icon Re: Help with WScript

MAttA,

The Win2000 upgrade probably backleveled the binaries for WSH as well as the scripting engines and
scripting runtime to v5.1 versions...

Upgrade IE to 5.5 or do a separate Windows Script 5.5 upgrade...

31-01-2005 at 08:56 AM
View Profile Send Email to User Show All Posts | Quote Reply
MattA
Level: Whizz Kid

Registered: 13-08-2003
Posts: 15
icon Re: Help with WScript

I recently got a new PC and guess what, it no longer works. I have installed the last version of the Scripting but to no avail. I am getting the same automation error as I was when I first logged the message.
Again any pointers would be gratefully received

11-02-2005 at 02:47 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : ASP.Net : Help with WScript
Previous Topic (DateFormat in C#?)Next Topic (Error: ATL Server Debugging) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder