1.

Solve : HELP Using XCOPY command with Network Map?

Answer»

Hello everyone.

I am currently using 2 Windows 2000 Servers.

I am trying to copy multiple directories from a network mapped drive. when xcopy launches, its telling me that its an "Invalid Drive Specification".

I currently used the F: drive using the NET USE command in DOS.

my batch file starts this way...

NET USE F: \\2KSERVER\DATA

XCOPY F:\ C:\DATA /S /E /V /Y >>C:\LOG\SERVER.LOG 2>>C:\LOG\ERR.LOG

after inspecting the ERR.LOG file, it states that its an Invalid Drive Specification.
I can change my drive letter to F: from the DOS prompt.
Im not sure as to why its not copying any files.
I am logged in to each system as Administrator.
when running the XCOPY command DIRECTLY from the DOS prompt and not in a batch file, it works without any type of error.
Only running the XCOPY command from a batch PROGRAM gives me this error.

Any help is appreciated!!
thanks
Jes

Try using a UNC path:
Code: [Select]XCOPY \\2KSERVER\DATA\*.* C:\DATA\ /S /E /V /Y >>C:\LOG\SERVER.LOG 2>>C:\LOG\ERR.LOGI also like to include the *.* in the source and trailing \ for the destinationHi,

It definitely did work from the command prompt but not within a batch file. The command above is exactly what I used, but with the same error. UNC or MAPPED Drive doesnt seem to want to work within a batch program. Im not sure why the XCOPY command
refuses to work within a Batch file.

Any criteria when using XCOPY within batch programs? If it works directly within the command prompt, why wouldnt it work in a batch file??

Thanks for your suggestion. If anyone can help, It is appreciated!!

Jes

If it does not work from within a batch file, rename the batch file from *.bat to *.cmd and see if that resolves the issue.No luck renaming my batch file from *.BAT to *.CMD.
Is it possible that the Task Scheduler has limited access to network drives?
Can I force the Administrator account to login from a batch command?

Not sure how to proceed.

Thanks again for all your suggestions!!

Any task from task scheduler runs under some user credentials (when you set up the task in task scheduler, you have to add a user also). Everything should work fine if it works in command line. Have you checked the rights of that share? The user has all necessary rights there (read rights)? Have you checked with the user account you use for the task?Yes full rights to everything including local and domain admins.
Under the Services, Task Scheduler runs as the LocalSystem Account.
The Server is logged in as admin to the domain w full rights. When changing the "task Scheduler" to logon as administrator, I cant restart the "Task Scheduler" service. it gives me this error "Error 6200 : The task scheduler must be configured to run in the System account to function properly. Individual tasks may be configured to run in other accounts."
After getting this error, I change the user back to "LocalSystem" and it starts normally.

I can't seem to force the local Administrator or Domain Administrator to start this service.

Thanks
JesNo, don't change the account for Task Scheduler, just PAY attention at with what account credentials the task is run. Task Scheduler runs with the System account, but any task scheduled to run from Task scheduler may use any other account - the error description is self explanatory. Don't force the service to start with other account.
I would verify again the rights of the account that should run the task. Has all the necessary rights on the different places which the task needs?
For example, I create a task, a scheduled task, which needs to run the file a.bat at different times. In a.bat I have to copy some files from \\computer1\share1 to \\computer2\share2. I will use the account MyAccount (global account or an account with the same password on both computers).
I create the bat, I verify with the administrator account: it works fine (if administrator is the same on both computers, has the same password or the computers are members of a AD and I use the global administrator account).
I set the security rights for share1 and share2 (on computer1 and computer2).
Share1: MyAccount: right to read the share; security rights: right to read the folder (at least)
Share2: MyAccount: right to write to share; security rights: right to write to folder (at least)
After that, all should run just fine. If, for example, I don't set the rights for share2 to at least write (for example I leave share rights to read only, or security rights to read or list directory only), the task won't execute.
By the way, the MyAccount has to have the rights to read the bat file on the computer with the task scheduler (I had a issue like that, once, when all was set up right, just the account wasn't allowed to read the bat file)



Discussion

No Comment Found