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

Running a .DAT file through VB using a Shell ??

Status
Not open for further replies.

bjgolden80

Programmer
Feb 6, 2003
15
US
Hi,

I am trying to run a .DAT file that contains ftp commands through a shell in VB (unsuccessfully).

Right now I am manually running a .DAT file through DOS to ftp files, but I want my VB program to do it on completion of file creation.

I need to pass the following commands to DOS through VB:

>cd q:
>ftp -ivs:ftptest.dat

Can anyone help me on the correct use of shell commands to do this ?

thanks!
 
Copy your DOS commands into a text file and save it with a ".bat" extension. Then run it from VB like so:

Shell("C:\path\to\batch\file\batchfile.bat")

Of course, put the correct path and filename for your batch file.



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Great...thanks for this. However the bat file just seems to run infinitely and never actually does anything other than repeat the commands over and over again ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top