|
-
December 3rd, 1998, 06:20 AM
#1
to run a DOS Batch (.bat file) from a VB app
I want to run a DOS Batch (.bat file) from a VB app. For this I'm using
Shell() in VB. .BAT files can accept parameters.
When I pass param, as it is, to .bat file, it runs fine. ie. :--
RetVal=Shell("abc.bat xyz",vbHide) 'Here xyz is the param value
But when I pass param using a var which has the value for param, it
doesn't work ! i.e. :--
RetVal=Shell("abc.bat ParamVar",vbHide) 'here ParamVar contains the
value for param
Is there any way (any Function) by which paramete(s) can be passed to a
.bat file using variable(s) as in the second case above ???
Is there any special char to put as prefix with the variable containing
parameter value ????
-
December 4th, 1998, 08:46 PM
#2
Re: to run a DOS Batch (.bat file) from a VB app
Basicaly if i am reading this correctly, your mistake is
sending the paramater out as a string rather than a variable string.
try something like this
var="c:\"
retval=shell("dir "+var,0)
where var is your paramater or variable, this must! always be outside the quotes unlike your previous attempt which was somthing like this..
retval=shell("dir var",0)
this is Wrong!
hope this helps!? 
Christopher
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|