Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to launch a batch file along with a text file as an input

Status
Not open for further replies.

meonnebula

Technical User
Mar 21, 2011
1
GB
Hello all,

I'm trying to write a VBScript routine (to be run from Matlab) which automatically launches a batch file and submit the contents of a text file as an input to this batch file (instead of entering it manually).
The names of the batch file and the name of the text input file are known and therefore do not need to be passed as variables. In other words they can be hard-coded in the VBScript routine.

I'm using VBScript to bypass DOS as it doesn't accept UNC paths.
I've been spending way too much time on this but not getting much closer to the answer. Therefore, any help would be greatly appreciated.
Many thanks in advance.
 
DOS will do UNCs if they are first mapped.

net use x: \\server\path\share.

To pass an argument to a batch file, simple append the argument to the call. Refer to it in the BAT file a %<argument_number>

mybatchfile.bat "this" is 4 example

%1 = "this"
%2 = is
%3 = 4
%4 = exmaple

I may be wrong as I'm going off of personal experience.

-Geates

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding

"There are seldom good technological solutions to behavioral problems."
- Ed Crowley, Exchange guru and technology curmudgeon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top