Rename files “The syntax of the command is incorrect” .batHow can I pass arguments to a batch file?Split long commands in multiple lines through Windows batch fileWindows batch files: .bat vs .cmd?How do I shutdown, restart, or log off Windows via a bat file?How to run multiple .BAT files within a .BAT fileHow do I rename the extension for a batch of files?How to rename a file using PythonRename multiple files in a directory in PythonHow do I run two commands in one line in Windows CMD?Renaming multiple files by name
Today is the Center
Is it possible to create light that imparts a greater proportion of its energy as momentum rather than heat?
Blender 2.8 I can't see vertices, edges or faces in edit mode
Why can't we play rap on piano?
AES: Why is it a good practice to use only the first 16bytes of a hash for encryption?
Emailing HOD to enhance faculty application
Did Shadowfax go to Valinor?
What is the PIE reconstruction for word-initial alpha with rough breathing?
Why do I get two different answers for this counting problem?
What killed these X2 caps?
How to show the equivalence between the regularized regression and their constraint formulas using KKT
Do I have a twin with permutated remainders?
What does it mean to describe someone as a butt steak?
I Accidentally Deleted a Stock Terminal Theme
Why does Arabsat 6A need a Falcon Heavy to launch
Assassin's bullet with mercury
Is it possible to run Internet Explorer on OS X El Capitan?
How could indestructible materials be used in power generation?
Has there ever been an airliner design involving reducing generator load by installing solar panels?
Is Lorentz symmetry broken if SUSY is broken?
UK: Is there precedent for the governments e-petition site changing the direction of a government decision?
Is it canonical bit space?
Etiquette around loan refinance - decision is going to cost first broker a lot of money
Facing a paradox: Earnshaw's theorem in one dimension
Rename files “The syntax of the command is incorrect” .bat
How can I pass arguments to a batch file?Split long commands in multiple lines through Windows batch fileWindows batch files: .bat vs .cmd?How do I shutdown, restart, or log off Windows via a bat file?How to run multiple .BAT files within a .BAT fileHow do I rename the extension for a batch of files?How to rename a file using PythonRename multiple files in a directory in PythonHow do I run two commands in one line in Windows CMD?Renaming multiple files by name
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to remove a string from multiple file names in multiple directories. This is the file as with a few files being created so that I can check what values are actually being SET.
When I get to the rename
at the very bottom I get an error:
The syntax of the command is incorrect.
I don't see anything amiss in the _intf
and _fnlf
text files that get created. Is there some trick to using variables as the file path in a rename?
@ECHO off
echo Delete dir.txt?
PAUSE
del dir.txt
del item.txt
del file.txt
::paths for all directories in root (where filerename.bat is run)
::get root dir path
SET "_c=%CD%"
SET /A "counter=0"
::get dir list and concats root dir path before
FOR /F "tokens=*" %%A in ('DIR /on /b /a:d /p %svnLOCAL%') DO (
SET "_dirp=%_c%%%A"
CALL :sub1
SET /A "_counter+=1"
)
::finds each file in dir
:sub1
::make file to check dir path
ECHO "%_dirp%" > dir.txt
FOR /F "tokens=*" %%B in ('DIR /b %_dirp%') DO (
ECHO "%%B" > item.txt
SET "_item=%%B"
SET "_filep=%_dirp%"
CALL :sub2 %%~nB
PAUSE
)
ECHO "%_counter%"
EXIT /b 0
::builds file paths
:sub2
set "str=%*"
set "str=%str:[1]=%"
SET "_intf=%_filep%%_item%"
SET "_fnlf=%_filep%%str%"
CALL :sub3
EXIT /b 0
::Renames each file
:sub3
ECHO "%_intf%" > _intf.txt
ECHO "%_fnlf%" > _fnlf.txt
ren "%_intf%" "%_fnlf%.jpg"
EXIT /b 0
batch-file file-rename
add a comment |
I am trying to remove a string from multiple file names in multiple directories. This is the file as with a few files being created so that I can check what values are actually being SET.
When I get to the rename
at the very bottom I get an error:
The syntax of the command is incorrect.
I don't see anything amiss in the _intf
and _fnlf
text files that get created. Is there some trick to using variables as the file path in a rename?
@ECHO off
echo Delete dir.txt?
PAUSE
del dir.txt
del item.txt
del file.txt
::paths for all directories in root (where filerename.bat is run)
::get root dir path
SET "_c=%CD%"
SET /A "counter=0"
::get dir list and concats root dir path before
FOR /F "tokens=*" %%A in ('DIR /on /b /a:d /p %svnLOCAL%') DO (
SET "_dirp=%_c%%%A"
CALL :sub1
SET /A "_counter+=1"
)
::finds each file in dir
:sub1
::make file to check dir path
ECHO "%_dirp%" > dir.txt
FOR /F "tokens=*" %%B in ('DIR /b %_dirp%') DO (
ECHO "%%B" > item.txt
SET "_item=%%B"
SET "_filep=%_dirp%"
CALL :sub2 %%~nB
PAUSE
)
ECHO "%_counter%"
EXIT /b 0
::builds file paths
:sub2
set "str=%*"
set "str=%str:[1]=%"
SET "_intf=%_filep%%_item%"
SET "_fnlf=%_filep%%str%"
CALL :sub3
EXIT /b 0
::Renames each file
:sub3
ECHO "%_intf%" > _intf.txt
ECHO "%_fnlf%" > _fnlf.txt
ren "%_intf%" "%_fnlf%.jpg"
EXIT /b 0
batch-file file-rename
2
Tracing%_fnlf%
back to%_filep%
which is set with value of%_dirp%
. The 2nd argument ofren
is a filename only, yet you have a backslash, which will make the argument invalid. Seeren /?
.
– michael_heath
Mar 9 at 10:40
add a comment |
I am trying to remove a string from multiple file names in multiple directories. This is the file as with a few files being created so that I can check what values are actually being SET.
When I get to the rename
at the very bottom I get an error:
The syntax of the command is incorrect.
I don't see anything amiss in the _intf
and _fnlf
text files that get created. Is there some trick to using variables as the file path in a rename?
@ECHO off
echo Delete dir.txt?
PAUSE
del dir.txt
del item.txt
del file.txt
::paths for all directories in root (where filerename.bat is run)
::get root dir path
SET "_c=%CD%"
SET /A "counter=0"
::get dir list and concats root dir path before
FOR /F "tokens=*" %%A in ('DIR /on /b /a:d /p %svnLOCAL%') DO (
SET "_dirp=%_c%%%A"
CALL :sub1
SET /A "_counter+=1"
)
::finds each file in dir
:sub1
::make file to check dir path
ECHO "%_dirp%" > dir.txt
FOR /F "tokens=*" %%B in ('DIR /b %_dirp%') DO (
ECHO "%%B" > item.txt
SET "_item=%%B"
SET "_filep=%_dirp%"
CALL :sub2 %%~nB
PAUSE
)
ECHO "%_counter%"
EXIT /b 0
::builds file paths
:sub2
set "str=%*"
set "str=%str:[1]=%"
SET "_intf=%_filep%%_item%"
SET "_fnlf=%_filep%%str%"
CALL :sub3
EXIT /b 0
::Renames each file
:sub3
ECHO "%_intf%" > _intf.txt
ECHO "%_fnlf%" > _fnlf.txt
ren "%_intf%" "%_fnlf%.jpg"
EXIT /b 0
batch-file file-rename
I am trying to remove a string from multiple file names in multiple directories. This is the file as with a few files being created so that I can check what values are actually being SET.
When I get to the rename
at the very bottom I get an error:
The syntax of the command is incorrect.
I don't see anything amiss in the _intf
and _fnlf
text files that get created. Is there some trick to using variables as the file path in a rename?
@ECHO off
echo Delete dir.txt?
PAUSE
del dir.txt
del item.txt
del file.txt
::paths for all directories in root (where filerename.bat is run)
::get root dir path
SET "_c=%CD%"
SET /A "counter=0"
::get dir list and concats root dir path before
FOR /F "tokens=*" %%A in ('DIR /on /b /a:d /p %svnLOCAL%') DO (
SET "_dirp=%_c%%%A"
CALL :sub1
SET /A "_counter+=1"
)
::finds each file in dir
:sub1
::make file to check dir path
ECHO "%_dirp%" > dir.txt
FOR /F "tokens=*" %%B in ('DIR /b %_dirp%') DO (
ECHO "%%B" > item.txt
SET "_item=%%B"
SET "_filep=%_dirp%"
CALL :sub2 %%~nB
PAUSE
)
ECHO "%_counter%"
EXIT /b 0
::builds file paths
:sub2
set "str=%*"
set "str=%str:[1]=%"
SET "_intf=%_filep%%_item%"
SET "_fnlf=%_filep%%str%"
CALL :sub3
EXIT /b 0
::Renames each file
:sub3
ECHO "%_intf%" > _intf.txt
ECHO "%_fnlf%" > _fnlf.txt
ren "%_intf%" "%_fnlf%.jpg"
EXIT /b 0
batch-file file-rename
batch-file file-rename
edited Mar 9 at 10:57
Compo
17.1k3927
17.1k3927
asked Mar 8 at 23:29
Isaact94Isaact94
83
83
2
Tracing%_fnlf%
back to%_filep%
which is set with value of%_dirp%
. The 2nd argument ofren
is a filename only, yet you have a backslash, which will make the argument invalid. Seeren /?
.
– michael_heath
Mar 9 at 10:40
add a comment |
2
Tracing%_fnlf%
back to%_filep%
which is set with value of%_dirp%
. The 2nd argument ofren
is a filename only, yet you have a backslash, which will make the argument invalid. Seeren /?
.
– michael_heath
Mar 9 at 10:40
2
2
Tracing
%_fnlf%
back to %_filep%
which is set with value of %_dirp%
. The 2nd argument of ren
is a filename only, yet you have a backslash, which will make the argument invalid. See ren /?
.– michael_heath
Mar 9 at 10:40
Tracing
%_fnlf%
back to %_filep%
which is set with value of %_dirp%
. The 2nd argument of ren
is a filename only, yet you have a backslash, which will make the argument invalid. See ren /?
.– michael_heath
Mar 9 at 10:40
add a comment |
1 Answer
1
active
oldest
votes
Your error is because you're not using the REName
command correctly.
This can be noted by entering Ren /?
at the Command Prompt, which shows the syntax as:
REN [drive:][path]filename1 filename2
You however seem to be using:
REN [drive:][path]filename1 [drive:][path]filename2
…which will produce the error:
The syntax of the command is incorrect.
As a simple fix for your script, you'd need to change the following line:
set "str=%str:[1]=%"
to:
set "_fnlf=%str:[1]=%"
Then remove the line:
SET "_fnlf=%_filep%%str%"
If you wanted to tidy the code up you could probably change it to:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
Call Ren "%~dp0%%A%%B" "%%$:[1]=%%.jpg"
)
)
Echo "%i%"
Pause
Or Using DelayedExpansion:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
SetLocal EnableDelayedExpansion
Ren "%~dp0%%A%%B" "!$:[1]=!.jpg"
EndLocal
)
)
Echo "%i%"
Pause
In the two examples above, I've taken your comment, where filerename.bat is run
, to mean the directory in which this script, filerename.bat
, is located. If you meant the current working directory, which is not necessarily the same, you should replace the instances of %~dp0
above with %__CD__%
.
Additionally, as is not clear from the information you've provided, I have assumed that %svnLOCAL%
has already been defined.
Thank you Compo. I changed my original file, per your suggestion, to fit the needed syntax of the command and it work great. I pulled a bit of code from another post here which is where that '%svnLOCAL%' came from. It worked for some reason but I just changed it to '%CD%' and it functions the same as far as I can tell - am I missing something on how the 'DIR' works?
– Isaact94
Mar 11 at 12:41
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072400%2frename-files-the-syntax-of-the-command-is-incorrect-bat%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your error is because you're not using the REName
command correctly.
This can be noted by entering Ren /?
at the Command Prompt, which shows the syntax as:
REN [drive:][path]filename1 filename2
You however seem to be using:
REN [drive:][path]filename1 [drive:][path]filename2
…which will produce the error:
The syntax of the command is incorrect.
As a simple fix for your script, you'd need to change the following line:
set "str=%str:[1]=%"
to:
set "_fnlf=%str:[1]=%"
Then remove the line:
SET "_fnlf=%_filep%%str%"
If you wanted to tidy the code up you could probably change it to:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
Call Ren "%~dp0%%A%%B" "%%$:[1]=%%.jpg"
)
)
Echo "%i%"
Pause
Or Using DelayedExpansion:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
SetLocal EnableDelayedExpansion
Ren "%~dp0%%A%%B" "!$:[1]=!.jpg"
EndLocal
)
)
Echo "%i%"
Pause
In the two examples above, I've taken your comment, where filerename.bat is run
, to mean the directory in which this script, filerename.bat
, is located. If you meant the current working directory, which is not necessarily the same, you should replace the instances of %~dp0
above with %__CD__%
.
Additionally, as is not clear from the information you've provided, I have assumed that %svnLOCAL%
has already been defined.
Thank you Compo. I changed my original file, per your suggestion, to fit the needed syntax of the command and it work great. I pulled a bit of code from another post here which is where that '%svnLOCAL%' came from. It worked for some reason but I just changed it to '%CD%' and it functions the same as far as I can tell - am I missing something on how the 'DIR' works?
– Isaact94
Mar 11 at 12:41
add a comment |
Your error is because you're not using the REName
command correctly.
This can be noted by entering Ren /?
at the Command Prompt, which shows the syntax as:
REN [drive:][path]filename1 filename2
You however seem to be using:
REN [drive:][path]filename1 [drive:][path]filename2
…which will produce the error:
The syntax of the command is incorrect.
As a simple fix for your script, you'd need to change the following line:
set "str=%str:[1]=%"
to:
set "_fnlf=%str:[1]=%"
Then remove the line:
SET "_fnlf=%_filep%%str%"
If you wanted to tidy the code up you could probably change it to:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
Call Ren "%~dp0%%A%%B" "%%$:[1]=%%.jpg"
)
)
Echo "%i%"
Pause
Or Using DelayedExpansion:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
SetLocal EnableDelayedExpansion
Ren "%~dp0%%A%%B" "!$:[1]=!.jpg"
EndLocal
)
)
Echo "%i%"
Pause
In the two examples above, I've taken your comment, where filerename.bat is run
, to mean the directory in which this script, filerename.bat
, is located. If you meant the current working directory, which is not necessarily the same, you should replace the instances of %~dp0
above with %__CD__%
.
Additionally, as is not clear from the information you've provided, I have assumed that %svnLOCAL%
has already been defined.
Thank you Compo. I changed my original file, per your suggestion, to fit the needed syntax of the command and it work great. I pulled a bit of code from another post here which is where that '%svnLOCAL%' came from. It worked for some reason but I just changed it to '%CD%' and it functions the same as far as I can tell - am I missing something on how the 'DIR' works?
– Isaact94
Mar 11 at 12:41
add a comment |
Your error is because you're not using the REName
command correctly.
This can be noted by entering Ren /?
at the Command Prompt, which shows the syntax as:
REN [drive:][path]filename1 filename2
You however seem to be using:
REN [drive:][path]filename1 [drive:][path]filename2
…which will produce the error:
The syntax of the command is incorrect.
As a simple fix for your script, you'd need to change the following line:
set "str=%str:[1]=%"
to:
set "_fnlf=%str:[1]=%"
Then remove the line:
SET "_fnlf=%_filep%%str%"
If you wanted to tidy the code up you could probably change it to:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
Call Ren "%~dp0%%A%%B" "%%$:[1]=%%.jpg"
)
)
Echo "%i%"
Pause
Or Using DelayedExpansion:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
SetLocal EnableDelayedExpansion
Ren "%~dp0%%A%%B" "!$:[1]=!.jpg"
EndLocal
)
)
Echo "%i%"
Pause
In the two examples above, I've taken your comment, where filerename.bat is run
, to mean the directory in which this script, filerename.bat
, is located. If you meant the current working directory, which is not necessarily the same, you should replace the instances of %~dp0
above with %__CD__%
.
Additionally, as is not clear from the information you've provided, I have assumed that %svnLOCAL%
has already been defined.
Your error is because you're not using the REName
command correctly.
This can be noted by entering Ren /?
at the Command Prompt, which shows the syntax as:
REN [drive:][path]filename1 filename2
You however seem to be using:
REN [drive:][path]filename1 [drive:][path]filename2
…which will produce the error:
The syntax of the command is incorrect.
As a simple fix for your script, you'd need to change the following line:
set "str=%str:[1]=%"
to:
set "_fnlf=%str:[1]=%"
Then remove the line:
SET "_fnlf=%_filep%%str%"
If you wanted to tidy the code up you could probably change it to:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
Call Ren "%~dp0%%A%%B" "%%$:[1]=%%.jpg"
)
)
Echo "%i%"
Pause
Or Using DelayedExpansion:
@Echo Off
Set "i=0"
For /F "Delims=" %%A In ('Dir /B/AD "%svnLOCAL%" 2^>Nul') Do (
Set /A i+=1
For /F "Delims=" %%B In ('Dir /B/A-D "%~dp0%%A*[1]*" 2^>Nul') Do (
Set "$=%%~nB"
SetLocal EnableDelayedExpansion
Ren "%~dp0%%A%%B" "!$:[1]=!.jpg"
EndLocal
)
)
Echo "%i%"
Pause
In the two examples above, I've taken your comment, where filerename.bat is run
, to mean the directory in which this script, filerename.bat
, is located. If you meant the current working directory, which is not necessarily the same, you should replace the instances of %~dp0
above with %__CD__%
.
Additionally, as is not clear from the information you've provided, I have assumed that %svnLOCAL%
has already been defined.
edited Mar 9 at 13:07
answered Mar 9 at 12:59
CompoCompo
17.1k3927
17.1k3927
Thank you Compo. I changed my original file, per your suggestion, to fit the needed syntax of the command and it work great. I pulled a bit of code from another post here which is where that '%svnLOCAL%' came from. It worked for some reason but I just changed it to '%CD%' and it functions the same as far as I can tell - am I missing something on how the 'DIR' works?
– Isaact94
Mar 11 at 12:41
add a comment |
Thank you Compo. I changed my original file, per your suggestion, to fit the needed syntax of the command and it work great. I pulled a bit of code from another post here which is where that '%svnLOCAL%' came from. It worked for some reason but I just changed it to '%CD%' and it functions the same as far as I can tell - am I missing something on how the 'DIR' works?
– Isaact94
Mar 11 at 12:41
Thank you Compo. I changed my original file, per your suggestion, to fit the needed syntax of the command and it work great. I pulled a bit of code from another post here which is where that '%svnLOCAL%' came from. It worked for some reason but I just changed it to '%CD%' and it functions the same as far as I can tell - am I missing something on how the 'DIR' works?
– Isaact94
Mar 11 at 12:41
Thank you Compo. I changed my original file, per your suggestion, to fit the needed syntax of the command and it work great. I pulled a bit of code from another post here which is where that '%svnLOCAL%' came from. It worked for some reason but I just changed it to '%CD%' and it functions the same as far as I can tell - am I missing something on how the 'DIR' works?
– Isaact94
Mar 11 at 12:41
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55072400%2frename-files-the-syntax-of-the-command-is-incorrect-bat%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Tracing
%_fnlf%
back to%_filep%
which is set with value of%_dirp%
. The 2nd argument ofren
is a filename only, yet you have a backslash, which will make the argument invalid. Seeren /?
.– michael_heath
Mar 9 at 10:40