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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Encryption

From novice to tech pro — start learning today.