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

Escape characters needed in Shell Call ???

Status
Not open for further replies.

cucswiz

Programmer
Jun 25, 2001
13
US
I am tryint to use the Shell call to run something from within VB. Currently this is what I am trying to do:

Dim ID
ID = Shell(&quot;e:\mysql\bin\mysql <new.sql> errors.log&quot;)

For some reason this doesnt work. However, I know that the new.sql file is correct, because if I do it manually inside the command prompt everything works find..... However, when I try to make this call, the command prompt pops up, then closes by itself... Anyone know why this is happening??? could it be cause I have the &quot;<&quot; in the string??
 
I've run into this problem before. I can't remember why it was happening now, I think it had something to do with spaces or something... A cheap way to get around it would be to make a batch file with your desired command line and then just shell to the batch, like

open &quot;commandline.bat&quot; for binary as #1
batchfile$ = &quot;e:\mysql\bin\mysql <new.sql> errors.log&quot;
Put #1,, batchfile$ : close #1

Shell (&quot;commandline.bat&quot;)

I'm sure someone can give you a better answer.. Cheesey tricks can come in handy though... :)

 
I have tried to do this.. however it doesnt seem to work either!... ugh It just does the same thing.. pops open a command prompt but then shuts off..

However when I manually do it.. it seems to work fine.... ugh people any helphere???
 
Nope. no help there. Anyone have any solution to this?? I've tried the regular calling approach.. and the batch file approach.. These all result in the same thing - basically a command prompt pops up... then closes up.

Please if you know anything about using VB's shell.. or a similar function in VB that can call other applications, i would really appreciate some input. Thanks..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top