General discussion

Locked

Xcopy and batch file

By Blackcurrant ·
Hi

I have created a batch file which copies new and changed files from a networked storage device to a computer

I am using the xcopy command and have used the following syntax:

start /wait /b xcopy "source" "destination" /c /d /s /e /k /y /z /i

at the start and end of the batch file I have included eventcreate commands to log when the batch file starts and finishes

Now, when I was testing the file, I see a command window, and can see that the eventcreate command successfully writes entries to the application log stating the batch file has started, and later an entry is written stating the file has finished. However, after the second eventcreate command has been processed, and I can see the event in the application log, the batch file continues.

When the batch file runs the command window shows the full path for each command in the batch file:

c:\computers\Batch files\Backup\start /wait /b xcopy "source" "destination" /c /d /s /e /k /y /z /i

After the second eventcreate command has been processed I see a long list of:

0 files copied
1 files copied
0 files copied
0 files copied
5 files copied
"source"/filename.ext
0 files copied
2 files copied

Does anyone know what is happening here? I assumed that the second eventcreate command at the end of the batch file would be the last command to be processed, especially as all preceeding commands use the start /wait switch.

I was wondering if this was a verification process... but think not.

This conversation is currently closed to new comments.

13 total posts (Page 2 of 2)   Prev   01 | 02
Thread display: Collapse - | Expand +

All Comments

Collapse -

by Blackcurrant In reply to Xcopy and batch file

Point value changed by question poster.

Collapse -

by Blackcurrant In reply to Xcopy and batch file

This question was closed by the author

Collapse -

Its good But i have 1 question

by abhishek1singh In reply to Xcopy and batch file

hi Blackcurrant
i want copy my folder from same location where from i run my batch file and paste to different location.
it means my source folder location will be same where from run my batch file,
So what will be the code for it

Thank you
in advance
Bcz i know its very small query 4r u.

Back to Windows Forum
13 total posts (Page 2 of 2)   Prev   01 | 02

Related Discussions

Related Forums