Solved

encrypt password in the batch file for net use command

Posted on 2008-06-23
5
15,770 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
[X]
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
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

Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

751 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