• Skip to primary navigation
  • Skip to main content
  • Skip to footer

JH Tech Services

A knowledgebase

  • Portfolio
  • Knowledgebase
  • About

XCOPY redirect stdout and stderr

May 23, 2008 by jer0dh

Created a script to copy files called migrate.cmd. With this script I can do an initial copy of everything. I could then rerun it to copy only new files during the day of migration. Speeds things up quite a bit to only have to copy changed files from the day before.

But found that any errors produced still went to the console or command line and I couldn’t see which files it complained.. Finally found the syntax to redirect stderr to stdout and redirect all of stdout(with stderr) into a file.

Here it is

xcopy /D /I /E /C /F /H /R /K /O /Y f:data l:data > migrate.log 2>&1

  • Knowledgebase
  • Uncategorized

Footer

  • Portfolio
  • Knowledgebase
  • About

© 2023