in Education by
I am trying to retrieve a particular file from multiple FTP servers. those server details are stored in Excel file. So I am writing VBA code to generate a .bat file. Code: Const script = "C:\Users\xyz.abc\trial.bat" Dim fileno As Integer Dim retval As Variant fileno = FreeFile Open script For Output As #fileno Dim i As Integer Print #fileno, "open " & Cells(2, 2).Value 'server ip Print #fileno, Cells(2, 3).Value 'username Print #fileno, Cells(2, 4).Value 'password Print #fileno, "cd " & Cells(2, 5).Value 'path Print #fileno, "get " & Cells(2, 6).Value 'filename Print #fileno, "bye" Print #fileno, "open " & Cells(3, 2).Value 'server ip Print #fileno, Cells(3, 3).Value 'username Print #fileno, Cells(3, 4).Value 'password Print #fileno, "cd " & Cells(3, 5).Value 'path Print #fileno, "get " & Cells(3, 6).Value 'filename Print #fileno, "bye" Close #fileno The problem I am facing is it is logging to the first server, retrieving file and then stopping. It's not going on to next server login. Individually it is working for both servers. Help me with this multiple logins through .bat file. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The bye command exits the ftp.exe. You want to use the close command (or its disconnect alias) to disconnect only. Use the bye only at the very end, after the last server.

Related questions

0 votes
    I want to execute a certain batch file and redirect its console output to a text control in visual c ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I want to execute a certain batch file and redirect its console output to a text control in visual c ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    The cipher generated by combining multiple transformations to enhance the security of the resultant cipher is __________ ... ciphers (3)Transformation ciphers (4)Product ciphers...
asked Mar 19, 2021 in Technology by JackTerrance
0 votes
    Which feature is provided by Apache Sqoop to connect multiple data sources of different RDBMS Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Which feature is provided by Apache Sqoop to connect multiple data sources of different RDBMS Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    I have huge JSON files in a folder approx 200 each of 300 mbs approx. I need to write Spring ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    If you connect to a database or a file in a program you should always __________ it when you’re finished using it. Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    FTP is an acronym for- (a) File Transaction Protocol (b) File Truncation Protocol (c) File Translation ... File Transmission Protocol Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    To import a file from FTP, which of the following are the mandatory components? tFTPConnection, ... , tFTPGet tFTPConnection, tFTPGet tFTPConnection, tFTPExists, tFTPGet...
asked Mar 24, 2021 in Technology by JackTerrance
0 votes
    ________ distributes different data across multiple servers. 1. None of the options 2. Bucketing 3. Sharding 4. Partitioning...
asked Sep 6, 2021 by JackTerrance
0 votes
    Find a technique of splitting up a large collection among multiple servers. (1)Indexes (2)Sharding (3)Replication...
asked May 23, 2021 in Technology by JackTerrance
0 votes
    In MongoDB, _________ helps to synchronize data across multiple servers. (1)Indexes (2)Sharding (3)Replication...
asked May 22, 2021 by JackTerrance
0 votes
    What is the output file generated by the linker in C?...
asked Nov 9, 2020 in Technology by JackTerrance
0 votes
    I write a tool, It can get device id through the dll, and copy the id to clipboard. extern crate ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    I got some question regarding the shared and static libraries.So let me tell you what i did is, I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
...