Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing user name/password for.bat file copy commands

Status
Not open for further replies.

ktabaska

IS-IT--Management
Dec 26, 2002
2
US
Hello!
I am running a .bat file that needs to copy a file to a server on a different network. I have shared the drive on the server out to a particular ID, however, I have to log into that server, or pass it the credentials to gain access to the share. I have tried mapping the drive using the
net use x:\\server\share password /user:domain\user
command, however, the password parameter seems to be a password on the share itself, and not the user name password.
Does anyone have any idea how I could either log into the share using a .bat command line or pass my credentials in with the xcopy command?

Thanks Much!!

P.S.
I can copy the file fine with the share opened to everyone, however, this is a security gap I cannot leave open.
 
If this resource is only using share-level protection I would opt for user-level protection. This should appear as a separate option in the Sharing window. Once you do this you can have the "net use" command map the drive as an allowed user account.

Running these batch files as a scheduled task (AT command set) can be a little tricky. Sometimes you have to run the AT service as an allowed user of run the specifically scheduled task as an allowed user. Check this as well...
 
I have tried setting the share to a single user, but when I map the drive with net use, the only way it lets me map is by re-entering the password at a prompt.

I do not understand the symantics of the net use command.
Do you know if the password sent in is related to the share or to the user ID passed in? The command seems more for mapping drives on the same metwork, thereby not needing a user password because you are most likely already authenicated by being on the network. I need a way to authenticate between networks.

I would hate to have to set up the scheduled task using a real ID (currenty trying to use a generic app ID). Our user ID's expire every 90 days, and so i would have to manually change those passwords (over 20 .bat files and scheduled jobs).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top