Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently generating documentation on one machine, and publishing it to a web server using the following commands in a script:

net use "\\someShare" PASSWORD /user:username
del /S /Q "\\someShare"
xcopy /E /Y Documentation\html\* "\\someShare\"

However, it feels like a really bad idea to have a password as plain text in the script, so I'm looking for alternatives to my current solution. Ideas?

I definitely would appreciate a solution that uses some kind of access control, as many different people should be allowed to publish their own documentation to the web server, but not mess with each other's docs.

share|improve this question
Have you considered using FTP? – Sandokan Dec 10 '12 at 9:47
Or a Wiki? or CMS? – Rex Dec 19 '12 at 7:07

Active Directory for single sign on so that you don't have to supply a plain-text password in your script.

But maybe you don't want to or can't use AD. Well then, add the credentials to the Credential Manager in the Windows control panel. Then just copy stuff over using UNC paths and forget all that drive mapping noise.

Granular access control you can do with or without Active Directory, it's just a matter of whether you want to use domain accounts or local accounts. ACL your directories and shares however you want to give the desired access to whomever you want.

share|improve this answer

If this script is manually started and users can interact with the command prompt, why not remove the PASSWORD so it'll prompt for a password.

net use "\\someShare" /user:username
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.