R
Razvan Cosma
Greetings,
I am trying to use a very simple backup script that does something on
the lines of:
if exist y: net use y: /delete
(this one is needed just in case someone else logged on the system
mapped the same letter, and also to prevent a very annoying bug where
the mapped drive becomes "stale"? and although it is mapped I cannot
access the files)
net use y: \\1.2.3.4\share password /user:domain\user /persistent:no
xxcopy y:\files c:\ blah blah
(where xxcopy is a very handy utility from www.xxcopy.com)
The problem is while everything runs OK if started in a cmd prompt, when
I schedule it using either at or the task scheduler, it only works the
first time. Subsequent runs give the error:
System error 85 has occurred.
The local device name is already in use.
I have found several links to possible issues/solutions:
#1 A resource mapped by a logged on user cannot be unmapped by a
scheduled task.
This is very annoying as I could end up copying whatever data is on a
resource some user has assigned y: to
#2 A drive mapped by a background task cannot be accessed by an user
logged on interactively.
The solution to this is use different drive letters when running the
batch file from a command prompt.
#3 MS KB #253821
I tried altering the registry value - doesn't help and adds unneeded
security issues.
Also changing the timeout value for network shares from the default 15
minutes to whatever else does not work.
Thank you very much for any hints.
I am trying to use a very simple backup script that does something on
the lines of:
if exist y: net use y: /delete
(this one is needed just in case someone else logged on the system
mapped the same letter, and also to prevent a very annoying bug where
the mapped drive becomes "stale"? and although it is mapped I cannot
access the files)
net use y: \\1.2.3.4\share password /user:domain\user /persistent:no
xxcopy y:\files c:\ blah blah
(where xxcopy is a very handy utility from www.xxcopy.com)
The problem is while everything runs OK if started in a cmd prompt, when
I schedule it using either at or the task scheduler, it only works the
first time. Subsequent runs give the error:
System error 85 has occurred.
The local device name is already in use.
I have found several links to possible issues/solutions:
#1 A resource mapped by a logged on user cannot be unmapped by a
scheduled task.
This is very annoying as I could end up copying whatever data is on a
resource some user has assigned y: to
#2 A drive mapped by a background task cannot be accessed by an user
logged on interactively.
The solution to this is use different drive letters when running the
batch file from a command prompt.
#3 MS KB #253821
I tried altering the registry value - doesn't help and adds unneeded
security issues.
Also changing the timeout value for network shares from the default 15
minutes to whatever else does not work.
Thank you very much for any hints.