Solved

encrypt password in the batch file for net use command

Posted on 2008-06-23
5
15,880 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

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

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

In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
The recent Petya-like ransomware attack served a big blow to hundreds of banks, corporations and government offices The Acronis blog takes a closer look at this damaging worm to see what’s behind it – and offers up tips on how you can safeguard your…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

623 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