Patrick
Patrick

Reputation: 87

Trying to learn batch script, what does this do: /letter?

Here's the batch file:

@echo off
xcopy c:\testsource c:\testbackup /m /e /y

So I know that "xcopy c:\testsource c:\testbackup" copies the files in the testsource directory and pastes them in the testbackup directory, but what does the "/m /e /y" do? Can you explain what each individual part of this section of code does?

Also, would you mind telling me where I could look up explanations of syntax like this on my own in the future so I don't have to keep asking simple questions like this (a command for command prompt, maybe online database of commands and explanations, just something more efficient than google).

Upvotes: 1

Views: 85

Answers (2)

Florian Moser
Florian Moser

Reputation: 2663

Basically, in batch you first enter the command to be excuted, and then supply the arguments. Each command can be seen as an own small programm.

you are calling the command xcopy and supply those five arguments to it.

A documentation can be found here: https://technet.microsoft.com/de-ch/library/cc771254.aspx?f=255&MSPPError=-2147217396

you can also type in help COMMAND, for example help xcopy, to see a full list of arguments which can be passed to the command

Upvotes: 1

Jahwi
Jahwi

Reputation: 444

when in doubt, use the mighty /? behind most commands to get more information and extra switches. i.e: xcopy /? additionally, information on the /m /e and /y switches: xcopy /M Copies only files with the archive attribute set, turns off the archive attribute. xcopy /e Copies directories and subdirectories, including empty ones. and xcopy /y Suppresses prompting to confirm you want to overwrite an existing destination file. hope that helped!

Upvotes: 1

Related Questions