Page 1 of 1

"move" command WITH prompt if target exists?

Posted: 25 Sep 2022 11:41
by tobwz
Ok, I could move one or multiple files or folders on the command line in a batch script by a command like

move /y \"%1\" \"D:\mydata\\"

Unfortunately all files/folders are moved regardless if the target files/folders exist or not.

How can I extend the command above so that a prompt appears if the files/folders exists and ask me if I want to overwrite them?

Re: "move" command WITH prompt if target exists?

Posted: 25 Sep 2022 13:00
by aGerman
Run MOVE /? and read about the difference between options /Y and /-Y.

Steffen

Re: "move" command WITH prompt if target exists?

Posted: 27 Sep 2022 08:45
by tobwz
works.
Thank you