开发者

Create a batch file that pulls *.log files from directorys

开发者 https://www.devze.com 2023-03-14 07:36 出处:网络
I have looked on a lot of the questions here and I dont see really what I need. I am trying to create a batch file that pulls 6 log files from 2 different places.

I have looked on a lot of the questions here and I dont see really what I need. I am trying to create a batch file that pulls 6 log files from 2 different places.

The first开发者_如何学C place its pulling them from is the C:\ Second place is C:\COSS\CossEnterpriseSuite\Exes\

I am wanting it to pull the *.log files and for it to put them in a folder called ERRORLOG on the C:.

If anyone could help me with this it would be great the stress level is raising.


Try this:

xcopy /y C:\*.log C:\ERRORLOG
xcopy /y C:\COSS\CossEnterpriseSuite\Exes\*.log C:\ERRORLOG

This will wildcard-copy anything that ends with the .log extension from the directories you mentioned, dropping them in the C:\ERRORLOG directory. The /y switch makes sure it doesn't prompt before overwriting existing files.

0

精彩评论

暂无评论...
验证码 换一张
取 消