net use password managment

Hi,

could you pls suggest me the best way for below scenario?

Would like to map a share drive using "net use" in scripting. ...do some stuff (copy,write/delete) ...then delete the drive.

Right now I have to pass the username/pwd as an argument.

Is there way to manage without providing the password?
or
Is there a way to encrypt the pwd and supply that in the argument?
or
Can I provide the password as an input text file to "net use" ...again encrypted
or
what is the best practice

thanks in advance
enthuguyAsked:
Who is Participating?
 
Gerwin Jansen, EE MVETopic Advisor Commented:
entheguy, we don't just provide links, we try to answer here on the EE site :)

But you just have to map the network drive manually once with the /savecred option, so just like this:

net use \\server\share /user:domain\account *

The * means that you will get a password prompt immediately, type the password.

Next time (same user), just map the drive without the /user and /savecred option.

The credential manager is where you can manage stored credentials, you can find
it in control panel, or start is using credmgr.msc
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
You can use /savecred to save credentials so you don't need to type them next time.
0
 
McKnifeCommented:
If we knew why you want to use it that way, it would be easier to answer.
0
 
enthuguyAuthor Commented:
thx Gerwin, could you point me to some link....on how to configure this in windows 2012. I saw something in Win8 called "Credential Manager"

Mckinfe, would like to map, do some stuff, and delete thru scripting. and I dont want to expose clear text password anywhere in my script or property file.
0
 
McKnifeCommented:
And why would a different credentialset be necessary? Won't it be possible to execute it as startup script or scheduled task right away?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.