Question

Locked

Output the output of a batch file in a log file

By happycoolrains ·
I am copying(XCOPY) and renaming(RENAME) certain files from one directory to the other. Basically doing a backup process using batch file.

I want to output the outputs of XCOPY and RENAME directly into a log file. How can I do this.?

Rgds,
Rains

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Redirect the output

by Bizzo In reply to Output the output of a ba ...

You can redirect the ouptut using ">" and ">>"

e.g.
xcopy folder1\file.txt . > output.log
rename file.txt filenew.txt >> output.log

Using ">" will create a file (in this case) called output.log. If the file already exists, it will be deleted.

Using ">>" will append to the file if it already exists, else it will create a new one.

Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums