The question could be a duplicate but I didn't find anything that explains it. I have a batch that changes hosts entries in Windows. Before it's doing that I want that it makes a copy in the same folder just as hosts.bak
and if the backup already exists it should overwrite it.
- 积分
0 - 话题
0 - 评论
3088 - 注册排名
2050
做就是了:
默认情况下,Out-File会覆盖文件(如果存在)
将此添加到您的CMD脚本中: