Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    3

    Unanswered: 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.

  2. #2
    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

  3. #3
    Join Date
    Jan 2004
    Posts
    3

    Thumbs up Re: system command in C

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •