I want to say some points on that:
Command-line parameters are obtainable via commandArgs(), so for understanding that in detail, write help(commandArgs).
You can use Rscript.exe on all operating systems, including Windows. It will support commandArgs().
There are two add-on packages on CRAN -- getopt and optparse -- which were both written for command-line parsing.
If you want to know more about R then do check out the R programming course.