1

What does copy %1 "Some\Filepath\Here" do in a .bat file?

I understand usually the copy command has two parameters a source and a destination. I don't understand in this specific case tho what is happening with the %1?

  • See CMD Cheat Sheet http://stackoverflow.com/questions/41030190/command-to-run-a-bat-file/41049135#41049135 – CatCat Jul 17 '18 at 20:30
  • Type `call /?` into a command prompt window to find out what `%1` means; refer also to this: [Command Line arguments (Parameters)](http://ss64.com/nt/syntax-args.html)... – aschipfl Jul 17 '18 at 20:33

1 Answers1

2

The %1 represents a command line parameter that is consumed by the batch file. If the name of your batch file is CopyMe.bat, then:

CopyMe SomeFileName.exe

would copy SomeFileName.exe to "Some\Filepath\Here".

Phil N DeBlanc
  • 398
  • 1
  • 13