Page 1 of 1

Batch file to copy a file to desktop

Posted: 22 Oct 2022 16:02
by data808
I have a batch file that will search and delete the files that I want. The code is this:

@echo off
del "%userprofile%\desktop\*hs_err_*.log"

So with that being said, how do I copy a file from a folder to the desktop using a batch file?

Re: Batch file to copy a file to desktop

Posted: 23 Oct 2022 04:03
by aGerman
The command for copying a file is COPY.

Code: Select all

copy "source" "destination"
... where source and destination have to be customized.

Steffen

Re: Batch file to copy a file to desktop

Posted: 23 Oct 2022 19:09
by data808
Worked like a charm. Thank you very much!!