3 Replies

  • It is an extremely bad practice to put passwords into a plaintext file of any kind.  I highly discourage this.  In today's cybersecurity environment, this is a major no no.

    PowerShell has some better credential handling than batch.  You have some PowerShell mixed in with your batch file.  Why not make it all PowerShell?

    You need the script to log into the servers how?  You haven't specified that either.

    I realize I'm not answering your direct question very well.  I don't think you are pursuing the proper solution.

    Spice (1) flagReport
    Was this post helpful? thumb_up thumb_down
  • Thank you for your answer JDDellGuy.
    The script will log into FTP sites, and the script and the text file will be stored safely, but if you think that PowerShell will manage this for me, why not provide me details or links so I can read about it.
    Meanwhile, If you can provide me also with how to do the loop in the batch script to read credentials from a text file to log in to FTP sites, to get the filenames ONLY, as this script did my needs.
    But because I have about 40 FTP directories, I decided to make the loop in the batch file as described above.
    Was this post helpful? thumb_up thumb_down
  • This article explains how to use FOR in a batch file to iterate through multiple components of a text file.  You will need to know what the delimiter in your text file is, and you will probably need to format your text file such that each server's data is found in a single row.  A CSV file may work well for that.


    This is an article which gives some information on FTP transfers in a batch file.


    As far as the text file of passwords being stored securely...if it's a plaintext file with passwords in it, that's not secure.  Just saying.

    Was this post helpful? thumb_up thumb_down

Read these next...