This is the code I have:
set thisfolder=%~dp0%
echo %thisfolder%
ROBOCOPY "%thisfolder%" "F:\batch testing\test\" copyself.bat
However the issue presents itself here:
F:\batch testing>set thisfolder=F:\batch testing\
F:\batch testing>echo F:\batch testing\
F:\batch testing\
F:\batch testing>ROBOCOPY "F:\batch testing\" "F:\batch testing\test\" copyself.bat
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Monday, March 5, 2018 7:26:54 AM
Source : F:\batch testing" F:\batch\
Dest : F:\batch testing\testing\test"\
Files : copyself.bat
Options : /DCOPY:DA /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
2018/03/05 07:26:54 ERROR 123 (0x0000007B) Accessing Source Directory F:\batch testing" F:\batch\
The filename, directory name, or volume label syntax is incorrect.
The source and destination paths seem distorted. Anyone know what's up with that?