General discussion


Batch Command in Vbscript

By v2kish ·
Hi ,
Can any one tell how to insert batch commands in vbscript to make it useful with single click .
using the follwoing code i am running bath file
Set WshShell = WScript.CreateObject("WScript.Shell")
obj = WshShell.Run("C:\hai\run.bat", 0)
set WshShell = Nothing

it invoking bat file and run commands in that file

now i want to place those commands in the bat file in to the vbs file with out using bat file to generate every thing using vbs how can code this.

please assist me thanking you in-advance

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

You started from the wrong end

by TobiF In reply to Batch Command in Vbscript

Command line batch files and VBscript are two different languages, with overlapping functionality.

In order for anyone (I'm not the right one, since I have no clue about VBscript) to be able to answer your question, you should show the code you currently have in the batch file.

Or... Hmmm. You could write a VBscript that would:
1. Search for an unused drive letter.
2. Instantiate a RAM-disk and mount it to the chosen drive letter.
3. Write the intended contents to a batch file on the RAM-disk.
4. Calls the newly written batch file.
5. Kills the RAM-disk.
At second though, maybe not, after all...

Related Discussions

Related Forums