Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

encrypt password in the batch file for net use command

Posted on 2008-06-23
5
15,682 Views
Last Modified: 2011-10-04
Hi,

I have a batch file to connect to the remote server using the net use command and i am using a service account for it.
But, the problem is that the password is in clear text so is there any way so that i can encrypt the password or any other option to store the password in registry files and call from there.

Please help me with this as i am not good at batch file scripting

Thanks a lot
0
Comment
Question by:deepikanandi
5 Comments
 
LVL 11

Expert Comment

by:rowansmith
ID: 21852219
At the end of the day you have to store the password somewhere where it is readable.

The only way to protect this password is via NTFS permissions to ensure that no one can read it who is not authorised to read it.

The other option is not to use a password and instead rely on the built-in account that the batch is running in.  this dosn;t really change your security posture as anyone with access to that account is also able to access the resources.

-Rowan
0
 
LVL 13

Accepted Solution

by:
TheCapedPlodder earned 500 total points
ID: 21853708
I use a freeware tool called cpau to encrypt my batch files with stored credentials.

You can find it here:

http://www.joeware.net/freetools/tools/cpau/index.htm

All of the details you need to get started are on the website or available from cpau /?

Once you've tried it if you have any specific cpau queries, let me know.

Cheers,

TCP
0
 

Expert Comment

by:netfriendsinc
ID: 25991588
I have a question on this.  I have a batch file that runs and maps a drive which includes plain text password, eg:

net use x: \\server\share /user:domain\users password123

how do i use cpau to run this batch file so that it is encrypted?  

I was thinking it was something like this:  

cpau -u domain\user -p password123 -ex batchfilename.bat -enc  

but I think thats wrong..and do all files need to be in the same directory?  I have shortcuts in 'all users' profile under startup so that each user who logs on will get the script..

Thank you!
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Businesses who process credit card payments have to adhere to PCI Compliance standards. Here’s why that’s important.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question