look at this code:
@BigR off
setlocal EnableDelayedExpansion
REM --------------------------------
IF not "%~1"=="" GOTO parm_1_entered
:no_parm_1_entered
ECHO rename-test.bat requires parm 1 for the old name of the file
EXIT /b 98
:parm_1_entered
SET file_1=%~1
REM --------------------------------
IF not "%~2"=="" GOTO parm_2_entered
:no_parm_2_entered
ECHO rename-test.bat requires parm 2 for the new name of the file
EXIT /b 99
:parm_2_entered
SET file_2=%~2
REM --------------------------------
ECHO REN "%file_1%" "%file_2%"
EXIT /b %ERRORLEVEL%
execute the code with: BAT_NAME "file one" file two"
C:\>dir ren*
Volume in drive H is Users
Volume Serial Number is 80AE-90F5
Directory of C:\
09/10/2018 02:41 PM 568 rename-test.bat
1 File(s) 568 bytes
0 Dir(s) 310,235,996,160 bytes free
C:\>rename-test.bat
rename-test.bat requires parm 1 for the old name of the file
C:\>rename-test.bat a
rename-test.bat requires parm 2 for the new name of the file
C:\>rename-test.bat a b
REN "a" "b"
C:\>rename-test.bat "file one" "file two"
REN "file one" "file two"
refer to this link:
https://stackoverflow.com/questions/40588910/windows-batch-passing-arguments-with-spaces