How to overwrite existing files in batch?

后端 未结 10 1325
猫巷女王i
猫巷女王i 2021-01-30 15:17

The following command copies and moves a file but I also need it to overwrite the file it\'s replacing.

xcopy /s c:\\mmyinbox\\test.doc C:\\myoutbox
10条回答
  •  长发绾君心
    2021-01-30 16:07

    you need to simply add /Y

    xcopy /s c:\mmyinbox\test.doc C:\myoutbox /Y
    

    and if you're using path with spaces, try this

    xcopy /s "c:\mmyinbox\test.doc" "C:\myoutbox" /Y
    

提交回复
热议问题