If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > system command in C

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-06-04, 18:54
cmacapili cmacapili is offline
Registered User
 
Join Date: Jan 2004
Posts: 3
system command in C

I tried this code manually into a DOS environment

ftp -vs:c:\Lattice\ftp_code.txt

The ftp_code.txt contains ftp commands, this works correctly to DOS, but when I do the following code to C,

system("ftp -vs:c:\\Lattice\\ftp_code.txt");

It gives a message:

Please enter folder name:

Followed by a bad command message..., Is this because of my OS?, I'm running in a Win2K environment, Thanks.
Reply With Quote
  #2 (permalink)  
Old 01-07-04, 12:19
fabiano fabiano is offline
Registered User
 
Join Date: Dec 2003
Location: Brasil, Goias, Goiania
Posts: 14
Re: system command in C

Hi cmacapili,

Please check out your "path" environment variable. The ftp command on DOS certainlly will be in path. But and your script file (ftp_code.txt)? Is there any "get" or "put" without an explicit path?

It seems you run ftp on DOS from the folder you're working in and from the "System" function the default folder is the OS folder.

Fabiano
Reply With Quote
  #3 (permalink)  
Old 01-07-04, 19:00
cmacapili cmacapili is offline
Registered User
 
Join Date: Jan 2004
Posts: 3
Thumbs up Re: system command in C

Quote:
Originally posted by fabiano
Hi cmacapili,

Please check out your "path" environment variable. The ftp command on DOS certainlly will be in path. But and your script file (ftp_code.txt)? Is there any "get" or "put" without an explicit path?

It seems you run ftp on DOS from the folder you're working in and from the "System" function the default folder is the OS folder.

Fabiano
Thanks Fabiano,

I did it, I just moved my file to the directory where my ftp_code.txt is located. They are all in one directory now, and it works. Thanks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On