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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BATCH Files with VB6

Status
Not open for further replies.

JR4VB

Technical User
Jan 13, 2003
36
0
0
US
I am Using VB6 to make batch files. The problem I am having is that when I save the file because it is a string value the very begining and end of the batch file has quotations. Then within VB when I try to run that batch file it bombs because it doesn't know what the quotes are. I'm a begining VB programmer and I have never used VB script.. and I was curious how to get rid of these quotes so the batch file will run properly? Or is there another way to accomplish this easier. Thanks for any info...

JR
 

One of two things (off the top of my head) are going on. The first is you are using Write to write to your file. If so change it to print. The other is your string is actually containing the quote characters (use debug.print to check). You can get rid of the quotes by testing for them with something like...
[tt]
If Left(StringVariable, 1) = """" Then StringVariable = Mid(StringVariable, 1)
[/tt]
and you can use the "Right" function to do the same.

Good Luck

 
sounds like it could be to do with the method you are using to write the file. I have done this in the past with no difficulty.

Which method are you using?
 
Ok Thanks Guys Looks like I need to use Print instead of Write.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top