• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

How do I encrypt passwords in batch files?

I have a Windows batch file that has passwords in it such as FTP or Shared Network access. I do not want to leave these batch command files laying around with the passwords in clear text. Is there a way to encrypt the passwords within them? Any help or guidence would be greatly appreciated!
2 Solutions
Robin CMSenior Security and Infrastructure EngineerCommented:
Simple answer: No.
You can set permissions on the file such that only the account used by the scheduler/user who the files are for can access them. That way you don't care that the password is there in plain text as only the authorised person/service can access it.
You could consider using IPSec/ISA/Firewall to only allow connections between the client and server, so then even if somebody does know the password they still can't log on unless they're on the right client.
Hi, if you need the script(s) to run unattended, then as robincm said, there's not a really good way to secure a password when it's stored in a script (at least, not with a high level of security). If you don't need the script to run unattended and don't mind entering the password, you can modify your script(s) to prompt for a password. If you would like further information on how to prompt for a password in a script, let me know. Bill.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now