Problem getting xcopy script to run on Windows 2008 server

I have an existing xcopy script that runs on a 2003 server consistantly. I copied it to a 2008 server and edited the paths for that environment. The script executes the first copy command, but never executes the 2nd, 3rd, 4th...copy command.

Here is a sample: It only runs the 1st xopy command all the time.
xcopy F:\B2D011391.bkf x: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
xcopy F:\B2D011392.bkf x: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
xcopy F:\B2D011393.bkf x: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
xcopy F:\B2D011394.bkf x: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
LVL 25
Tony GiangrecoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AustinComputerLabsCommented:
try using "call xcopy" for all but the last one.
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
And there's no explanation as to why - no error message - nothing?  
0
Tony GiangrecoAuthor Commented:
I just tried, same result:

xcopy F:\B2D011391.bkf  x\: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
xcopy F:\B2D011392.bkf  x\: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
xcopy F:\B2D011393.bkf  x\: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
xcopy F:\B2D011394.bkf  x\: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
0
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Lee W, MVPTechnology and Business Process AdvisorCommented:
Stop logging it - does it work - post a screen shot.

xcopy F:\B2D011391.bkf  x\: /e/v/c/i/f/d/y
xcopy F:\B2D011392.bkf  x\: /e/v/c/i/f/d/y
xcopy F:\B2D011393.bkf  x\: /e/v/c/i/f/d/y
xcopy F:\B2D011394.bkf  x\: /e/v/c/i/f/d/y

I always put spaces between the switches:

xcopy F:\B2D011391.bkf  x\: /e /v /c /i /f /d /y
xcopy F:\B2D011392.bkf  x\: /e /v /c /i /f /d /y
xcopy F:\B2D011393.bkf  x\: /e /v /c /i /f /d /y
xcopy F:\B2D011394.bkf  x\: /e /v /c /i /f /d /y

Finally, in this particular instance, you could use a for loop:

for /l %%a in (1,1,4) do @xcopy F:\B2D01139%%a.bkf  x\: /e /v /c /i /f /d /y
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AustinComputerLabsCommented:
Have you tried:

call xcopy F:\B2D011391.bkf x: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
call xcopy F:\B2D011392.bkf x: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
call xcopy F:\B2D011393.bkf x: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
xcopy F:\B2D011394.bkf x: /e/v/c/i/f/d/y >> c:\xcopy-logs\xcopy-log.txt
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
Call is used for batch files... you COULD do START but the problem with that is you'd be running 4 copies at once of large files from the same location to the same location which would likely SERIOUSLY impact performance.

Copied from the CALL /? help message:
C:\Documents and Settings\leew>call /?
Calls one batch program from another.

Open in new window

0
Tony GiangrecoAuthor Commented:
The backups are running now. I will try in the morning.
0
AustinComputerLabsCommented:
@ TG-TIS You could create a seperate batch file for each copy and then create a master batch file that uses the CALL command to execute each one of the four.

@ leew I have not used CALL for a while but I swore I used it to tell the system to return to execute more commands not just more batch files, my mistake ;-)
0
CompProbSolvCommented:
Is there any chance you have an xcopy.cmd or xcopy.bat lying around that this is invoking?  At least in the old days, if you invoked batch file from within a batch file, it wouldn't return to the original.

@AustinComputerLabs  This may be what you are remembering... using a CALL command to another batch file and then coming back when it is done
0
Tony GiangrecoAuthor Commented:
This is unusual, because it almost acts as if the line breaks are not recognised so it never sees the next command.

I created the script in notepad on the 2003 server and saved it as a cmd file. I copied it to the 2008 server, edited it in notepad and saved it as a cmd. The file type looks like it's recognized because the icon associated with the file is different from a notepad text file.
0
CompProbSolvCommented:
Can you post both files here?  Don't copy and paste the text, upload the actual files.
0
Tony GiangrecoAuthor Commented:
This for/do solution worked. Thanks for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.