There are a couple of ways, though they are relatively simple:
- Create an account on your computer with the same user name and password as the remote computer and have the bat file run as that account. (Or create an account on the remote machine with the same user name and password as your local machine)
- Connect to the remote machine and chose the option to save your credentials. Then run the schedule task under you user account so it will use the saved credentials.
- In the batch file use the net use command to connect to the share with a user name and password. The password will be in plain text in the batch file so this is not as secure as 1 or 2.
The syntax of net use is:
NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]
NET USE {devicename | *} [password | *] /HOME
NET USE [/PERSISTENT:{YES | NO}]