The syntax of the command is incorrect Ren command batch

November 7, 2012 at 03:22:36
Specs: Windows XP
hello title says it please help me im using the ren command and it doesnt seem to work

See More: The syntax of the command is incorrect Ren command batch

Report •

#1
November 7, 2012 at 03:59:57
Here's the syntax: http://www.microsoft.com/resources/...

Obviously, no-one can tell you what you are doing wrong as you don't tell us what you are doing.


Report •

#2
November 7, 2012 at 04:21:57
@echo off
CLS
:MENU
ECHO ...............................................
ECHO PRESS 1 or 2 to select your task, or 3 to EXIT.
ECHO ...............................................
ECHO 1 - Change to 1.4 vanila
ECHO 2 - Change to MEGABUILD
ECHO.
SET /P M=Type 1, 2, or 3, then press ENTER:
IF %M%==1 GOTO 1.4
IF %M%==2 GOTO 1.3
IF %M%==3 GOTO EOF
:1.4
ren %appdata%\ .minecraft minecraft(2)
ren %appdata%\ minecraft(1) .minecraft
GOTO MENU
:1.3
ren %appdata%\ .minecraft minecraft(1)
ren %appdata%\ minecraft(2) .minecraft
GOTO MENU

thats my code and it doesnt work on the ren part


Report •

#3
November 7, 2012 at 08:10:29
You appear to have an unwanted space after the first "\" in each of the "ren" commands.

Report •

Related Solutions

#4
November 8, 2012 at 00:31:27
still doesnt work :(

Report •

#5
November 8, 2012 at 00:58:39
Take out the @echo and show us the result when you try to run the batch file. Show everything that is printed on the screen.

Report •

#6
November 8, 2012 at 01:04:55

C:\Documents and Settings\user\Desktop>ECHO ....................................
...........
...............................................

C:\Documents and Settings\user\Desktop>ECHO PRESS 1 or 2 to select your task, or
3 to EXIT.
PRESS 1 or 2 to select your task, or 3 to EXIT.

C:\Documents and Settings\user\Desktop>ECHO ....................................
...........
...............................................

C:\Documents and Settings\user\Desktop>ECHO 1 - Change to 1.4 vanila
1 - Change to 1.4 vanila

C:\Documents and Settings\user\Desktop>ECHO 2 - Change to MEGABUILD
2 - Change to MEGABUILD

C:\Documents and Settings\user\Desktop>ECHO.


C:\Documents and Settings\user\Desktop>SET /P M=Type 1, 2, or 3, then press ENTE
R:
Type 1, 2, or 3, then press ENTER:


there you go


Report •

#7
November 8, 2012 at 02:41:16
Which number did you press? The "ren" command is never being reached in the output you print.

Report •

#8
November 8, 2012 at 18:05:16
Also, if %appdata% has any spaces, you need to use dbl quotes. Like:
ren "%appdata%\.minecraft" minecraft(2)
Also, does the filename of "minecraft" actually contain no name part, but only an extension? Or is your syntax off? If the file minecraft is in fact "minecraft" and not ".minecraft", you need to kill the dot.

Report •

#9
November 9, 2012 at 06:51:24
Don't use such labels. Fixed:
@echo off
CLS
:MENU
ECHO. ...............................................
ECHO. PRESS 1 or 2 to select your task, or 3 to EXIT.
ECHO. ...............................................
ECHO.1 - Change to 1.4 vanila
ECHO.2 - Change to MEGABUILD
ECHO.
SET /P M=Enter 1,2 or 3
IF %M%==1 GOTO :1
IF %M%==2 GOTO :2
IF %M%==3 GOTO :EOF
echo.Invalid choice.
pause > nul
Goto :MENU
:1
if exist "%appdata%\ .minecraft" (ren "%appdata%\ .minecraft" "minecraft(2)") else (echo."%appdata%\ .minecraft" does not exist)
if exist "%appdata%\ minecraft(1)" (ren "%appdata%\ minecraft(1)" ".minecraft") else (echo."%appdata%\ minecraft(1)" does not exist.)
GOTO :MENU
:2
if exist "%appdata%\ .minecraft" (ren "%appdata%\ .minecraft" "minecraft(1)") else (echo."%appdata%\ .minecraft" does not exist.)
if exist "%appdata%\ minecraft(2)" (ren "%appdata%\ minecraft(2)" ".minecraft") else (echo."%appdata%\ minecraft(2)" does not exist.)
GOTO :MENU

Report •

Ask Question