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!
bemara57Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AbqBillCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.