Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

encrypt password in the batch file for net use command

Posted on 2008-06-23
5
Medium Priority
?
16,124 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
3 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Businesses who process credit card payments have to adhere to PCI Compliance standards. Here’s why that’s important.
When you put your credit card number into a website for an online transaction, surely you know to look for signs of a secure website such as the padlock icon in the web browser or the green address bar.  This is one way to protect yourself from oth…
The viewer will learn how to count occurrences of each item in an array.
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.
Suggested Courses
Course of the Month7 days, 11 hours left to enroll

824 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