Run a vbs file from Visual Basic 
Author Message
 Run a vbs file from Visual Basic

How can I execute a vbs file from Visual Basic.  My code reads as follows:

    RunFile = Shell(NameofFile, vbHide)

I receive an error message.

Please Help!

Thanks



Mon, 12 Feb 2001 03:00:00 GMT  
 Run a vbs file from Visual Basic
NameofFile should include cscript.exe and full path to .vbs file.

Another option is to add the script control to your VB application.
check out http://msdn.microsoft.com/scripting/ ActiveX scripting in the
Hosting Information.
Regards,
Ian Morrish
http://wsh.glazier.co.nz WSHFAQ
http://ils.glazier.co.nz (NetMeeting)
http://www.glazier.co.nz

Quote:

>How can I execute a vbs file from Visual Basic.  My code reads as follows:

>    RunFile = Shell(NameofFile, vbHide)

>I receive an error message.

>Please Help!

>Thanks



Tue, 13 Feb 2001 03:00:00 GMT  
 Run a vbs file from Visual Basic
Try this:

Keep you RunFile line unchanged but in name of file, you must have:

CSCRIPT or WSCRIPT and the name of your wsh script ( with the .VBS or .JS
extension)

Quote:

>How can I execute a vbs file from Visual Basic.  My code reads as follows:

>    RunFile = Shell(NameofFile, vbHide)

>I receive an error message.

>Please Help!

>Thanks



Tue, 20 Feb 2001 03:00:00 GMT  
 Run a vbs file from Visual Basic
Or use the ShellExecute API which will execute the script using the
associated default handler for the script type.

--
---------------------
Joe Guidera
Microsoft MVP DTS
ClubWin Chapter 10
WUGNET

My email address is intentionally invalid.  Remove the ".---"
to get to my real address.

Quote:
>Try this:

>Keep you RunFile line unchanged but in name of file, you must have:

>CSCRIPT or WSCRIPT and the name of your wsh script ( with the .VBS or .JS
>extension)


>>How can I execute a vbs file from Visual Basic.  My code reads as follows:

>>    RunFile = Shell(NameofFile, vbHide)

>>I receive an error message.

>>Please Help!

>>Thanks



Wed, 21 Feb 2001 03:00:00 GMT  
 Run a vbs file from Visual Basic
Or take a look at the Microsoft Script Control.  It allows you to host
VBScript (or JScript) in your VB application.  This would allow you to run
the VBS in process without having to worry about hiding windows etc.  You
can get the control free from
http://msdn.microsoft.com/scripting/scriptcontrol

--
Regards

Andrew Clinick
Microsoft Scripting Program Manager
http://msdn.microsoft.com/scripting


Quote:
>Or use the ShellExecute API which will execute the script using the
>associated default handler for the script type.

>--
>---------------------
>Joe Guidera
>Microsoft MVP DTS
>ClubWin Chapter 10
>WUGNET

>My email address is intentionally invalid.  Remove the ".---"
>to get to my real address.


>>Try this:

>>Keep you RunFile line unchanged but in name of file, you must have:

>>CSCRIPT or WSCRIPT and the name of your wsh script ( with the .VBS or .JS
>>extension)


>>>How can I execute a vbs file from Visual Basic.  My code reads as
follows:

>>>    RunFile = Shell(NameofFile, vbHide)

>>>I receive an error message.

>>>Please Help!

>>>Thanks



Sat, 24 Feb 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to run VB-Scripts in Visual Studio - Visual Basic 6

2. Call VBS procedures from Visual Basic 6.0

3. call vbs from visual basic 6

4. call vbs from visual basic 6

5. How to run VBScript in Visual Basic ???

6. Running a VB Script from Visual Basic

7. Running Visual Basic Program from VB script

8. Running a Visual Basic Script During Logon

9. Running WSH VBScripts in Visual Basic

10. Checking if PS File is correct from within a programming language like Visual Basic

11. converting REG file into visual basic scripting host format

12. Calling *.vbs files to Run From Master VBS File

 

 
Powered by phpBB® Forum Software