DOS: how do you run a package without having to sign in?

I am running the xcopy command in a script package that copies a file to a shared drive on another workstation; however, the workstation requires a login before connecting to the shared folder. Is there a way to script enter / connect to a batch file?

early

+1


source to share


2 answers


You can use the command "net use x: \ servername \ sharename / u: username password" to log into the share in a batch file. However, entering a password into a plaintext batch file is generally a bad idea.



+4


source


You can use network usage to map a temporary drive and login using credentials. This is what we had to do. Perhaps there is a better way. Then, at the end of the script, we will undo the disk.



Here is a link to the net use command: http://www.cezeo.com/tips-and-tricks/net-use-command/

+2


source







All Articles