Computing.Net > Forums > Windows Vista > Batch file to juggle folder names

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file to juggle folder names

Reply to Message Icon

Name: nazz
Date: June 29, 2008 at 17:04:47 Pacific
OS: Vista
CPU/Ram: 2g
Product: custom
Comment:

Aiight I admit that I'm new to batch files and i have little to no programming experience. That said, I've been trying to get a batch file to work that will juggle two folders depending on my input and what folders exist already. This is what i've gotten so far...

it doesn't work. goto end isn't working in any case, so something must be buggered. The folder names and what I want them to do are correct, i must be screwing up the modifiers. Help plz!


@ECHO off


:BEGIN

SET /P variable="Rockband 1, GH3 2"

if "%VAR%" == "1" (
if exist "C:\GH3\GH3DATA" GOTO END;
ren C:\GH3\DATA GH3DATA
ren C:\GH3\ROCKBANDDATA DATA
GOTO END;
)


if "%VAR%" == "2" (
if exist "C:\GH3\ROCKBANDDATA" GOTO END
ren C:\GH3\DATA ROCKBANDDATA
ren C:\GH3\GH3DATA DATA
GOTO END;
)

:END
exec C:\GH3\GH3.exe



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: June 30, 2008 at 03:46:49 Pacific
Reply:

@echo off

choice /C:12 " Rockband 1, GH3 2 "
if ErrorLevel 2 (
if exist "C:\GH3\ROCKBANDDATA" goto :END
move C:\GH3\DATA ROCKBANDDATA
move C:\GH3\GH3DATA DATA
goto :END
)
if ErrorLevel 1 (
if exist "C:\GH3\GH3DATA" goto :END
move C:\GH3\DATA GH3DATA
move C:\GH3\ROCKBANDDATA DATA
goto :END
)
:END
Start "" "C:\GH3\GH3.exe"

:: End_Of_Batch

To rename a folder use MOVE not REN.
Batch does not recognize ; and exec is not a valid command. To get a short help on commands type at prompt the command code followed by /? e.g.

choice /?

Beware batch scripting is programming too.


0

Response Number 2
Name: nazz
Date: June 30, 2008 at 15:12:15 Pacific
Reply:

Thank you! Exactly what I need. This is for private use, so I don't plan on getting into any trouble with it ;)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows Vista Forum Home


Sponsored links

Ads by Google


Results for: Batch file to juggle folder names

Batch file to rename .tmp to .txt www.computing.net/answers/windows-vista/batch-file-to-rename-tmp-to-txt/2890.html

batch file to close explorer www.computing.net/answers/windows-vista/batch-file-to-close-explorer/5311.html

Batch file, compare folder names www.computing.net/answers/windows-vista/batch-file-compare-folder-names/4782.html