Kiran's personal website
Blog    Forums   Sitemap   Social    Phone

Knowledge base home, and site home.
List of all Knowledge base categories.
An alphabetical list of technical terms.
Contact Me
Contact me for knowledge base questions
My Blog
My articles, white papers, ideas and thoughts.


Executing a DOS Batch file with Shell with VBS script

Date Added January 1, 1970 | Print | Bookmark
'Executing a DOS Batch file with Shell with VBS script.

'Code by Kiran
'You can run Batch file with simple text file called VBS file without VB executable
'Paste following code on notepad and save it with .VBS extension; once you double click this it automatically executes the DO Batch file

Set oShell = CreateObject("")

sCmd = "C:\\yourbatchfile.bat"

' If you have spaces in the path, you can do like following instead:
'sCmd = Chr(34) & "j:\\yourbatchfile.bat" & Chr(34) 'commented

' The 0 will make it run hidden
oShell.Run sCmd, 0, False

' The 7 will make it run minimized
'oShell.Run sCmd, 7, False 'commented

Was this article helpful?

Yes No

Category: VB General

Last updated on January 1, 1970 with 5555 views


Home | About Me | Products | Support | Contact | Knowledgebase | Forums | Blog | Site map | Site Search | Subscribe | Links | Social | News

Travel | Guest Book | All Pages | History | Site Calendar | Recipes | Ex-Rates | UK Stuff | Downloads | Telugu Stuff | Tell a Friend | Feedback

Bookmark and Share
Terms of Use
Site contents Copyright © 2008-2009 Kiran Reddy. All rights reserved.