Discussion Locked

Batch Command in Vbscript

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

1 reply

by tobif

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...

This discussion is closed to new replies.