substitute
Technical User
I have a batch file which copies a set of files from a Windows 2000 server to another server. The file runs nightly as a scheduled task. The basic procedure looks like:
net use l: /delete
net use l: \\server\share\folder password /user:domain\user /persistent:no
xcopy e:\files l:\ /c/y
I've added stout and stderr redirection to a log file so I know what is happening.
The first time the procedure runs the first command fails "network name cannot be found" (as expected), the second succeeds and the third copies the files.
The next and every subsequent time the first command fails as before, the second fails "the local device name is already in use" and the third fails "Invalid drive specification"
If I change the drive letter (e.g. to M) the next run succeeds and the subsequent ones fail again.
I can run the procedure at any time in an interactive session. I've tried a range of credentials for the scheduled task including administrator. I've added a plain "net use" at the start and it confirms there are no drive mappings.
The procedure worked fine for a year until I rebooted the server 2 weeks ago. No Microsoft updates have been applied for some time.
The reason I map the drive with credentials is that my server isn't in the same domain as the remote server and there is no trust set up (it is against company policy) but the remote share needs to be protected against casual interference by average joe users.
Any ideas out there? I'm losing my hair over this!
Ian
net use l: /delete
net use l: \\server\share\folder password /user:domain\user /persistent:no
xcopy e:\files l:\ /c/y
I've added stout and stderr redirection to a log file so I know what is happening.
The first time the procedure runs the first command fails "network name cannot be found" (as expected), the second succeeds and the third copies the files.
The next and every subsequent time the first command fails as before, the second fails "the local device name is already in use" and the third fails "Invalid drive specification"
If I change the drive letter (e.g. to M) the next run succeeds and the subsequent ones fail again.
I can run the procedure at any time in an interactive session. I've tried a range of credentials for the scheduled task including administrator. I've added a plain "net use" at the start and it confirms there are no drive mappings.
The procedure worked fine for a year until I rebooted the server 2 weeks ago. No Microsoft updates have been applied for some time.
The reason I map the drive with credentials is that my server isn't in the same domain as the remote server and there is no trust set up (it is against company policy) but the remote share needs to be protected against casual interference by average joe users.
Any ideas out there? I'm losing my hair over this!
Ian