Our Newsletter


Subscribe to our Newsletter and we'll keep you notified of new products, giveaways and discounts.

We respect your email privacy and will never sell or share your details with anyone.


Knowledgebase Home | Glossary | Favorites | Contact | Login Knowledgebase Home | Glossary | Favorites | Contact | Login
Search the Knowledgebase Browse by Category
VBScript Exec
Article Details

Last Updated
23rd of February, 2009

User Opinions (0 votes)
No users have voted.

How would you rate this answer?
Helpful
Not helpful
Exec allows you to execute command line applications. It requires the WshShell Object.

The advantage of using Exec over RUN, is that exec allows you more flexibility over handling the output generated by command line applications.

This example simply runs the IPConfig command and displays the output on the screen.

Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("ipconfig")
Set objStdOut = objWshScriptExec.StdOut
strOutput = objStdOut.ReadAll
WScript.Echo strOutput





     
For more information about VBScript, check out our VBScript Training Videos
VBScript Training Videos
     



Visitor Comments
No visitor comments posted. Post a comment
Post Comment for "VBScript Exec"
To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Your Name:
   Email Address:
* Your Comment:
* Enter the code below:
 
Related Articles
No related articles were found.
Attachments
No attachments were found.