I am trying to pass two arguments into my .cmd script to create a folder for arg1 and define a source dir for arg2. The source dir is "Shared Documents". The problem is that I cannot pass a space or a wildcard into the argument without it stating that the path does not exist. I have also tried passing it with quotes, same results.
@set dirYr=%1
@set dir1=%2
@set connectionroot=https://somewhere.com/sites/foo_bar/foobar/FooBar::Source path
@set sourcepath=https://somewhere.com/sites/foo_bar/foobar/FooBar\%dir1%::Destination path
@set destinationpath=\\foo\bar\%dirYr%\%dir1%
::Check commandline argument to make sure that %2 is present.
IF NOT DEFINED dir1 (echo USAGE: foo_bar.cmd ^<YYYY^>^<Directory^|Filename^>GOTO badexit)
Any direction on how to get the script to accept an argument with spaces would be appreciated. I know that the argument needs quotes, I just do not know the syntax to have the quotes removed before it interpolates into the variable