Government Security
Network Security Resources

Jump to content

Photo

Batch File Not Working As Desired!

- - - - -
  • This topic is locked This topic is locked
5 replies to this topic

#1 ROGOnafets

ROGOnafets

    Private

  • Members
  • 7 posts

Posted 29 January 2010 - 10:17 PM

@echo off
COLOR 0C
cls

echo ===========================
echo ===========================
echo SaveGame Backup App
echo.
echo Created by ROG-Onafets
echo ===========================
echo ===========================
echo.

Pause

:MenuOne
echo.
echo Backup saves for:
echo.
echo (1)All games to Desktop*
echo (2)All games to C Drive (If any)
echo (3)All games to D Drive (If any)
echo (4)All games to F Drive (If any)
echo (5)All games to G Drive (If any)
echo (6)All Games to X Drive (If any)
echo (7)Specify Single Game
echo (20)Quit
echo.
echo *Note* If games are not installed, folders and saves will not
echo be backed up for that game.

echo.
set choice=
set /p var=Please enter in your option number:
if %var% == '1' GOTO 'ALLDes'
if %var% == '2' GOTO 'ALLCD'
if %var% == '3' GOTO 'ALLDD'
if %var% == '4' GOTO 'ALLFD'
if %var% == '5' GOTO 'ALLGD'
if %var% == '6' GOTO 'ALLXD'
if %var% == '7' GOTO 'MenuTwo'
if %var% == '20' GOTO 'Quit'

:ALLDes
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" md "%USERPROFILE%\Desktop\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" COPY "%USERPROFILE%\AppData\Local\Criterion Games\Burnout Paradise\Save\*.*" "%USERPROFILE%\Desktop\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
echo.
echo Burnout Paradise Saves Copied to Desktop!
echo.
Pause
GOTO END

:ALLCD
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" md "C:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" COPY "%USERPROFILE%\AppData\Local\Criterion Games\Burnout Paradise\Save\*.*" "C:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
echo.
echo Burnout Paradise Saves Copied to C Drive!
echo.
Pause
GOTO END

:ALLDD
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" md "D:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" COPY "%USERPROFILE%\AppData\Local\Criterion Games\Burnout Paradise\Save\*.*" "D:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
echo.
echo Burnout Paradise Saves Copied to D Drive!
echo.
Pause
GOTO END

:ALLFD
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" md "F:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" COPY "%USERPROFILE%\AppData\Local\Criterion Games\Burnout Paradise\Save\*.*" "F:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
echo.
echo Burnout Paradise Saves Copied to F Drive!
echo.
Pause
GOTO END

:ALLGD
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" md "G:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" COPY "%USERPROFILE%\AppData\Local\Criterion Games\Burnout Paradise\Save\*.*" "G:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
echo.
echo Burnout Paradise Saves Copied to G Drive!
echo.
Pause
GOTO END

:ALLXD
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" md "X:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" COPY "%USERPROFILE%\AppData\Local\Criterion Games\Burnout Paradise\Save\*.*" "X:\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
echo.
echo Burnout Paradise Saves Copied to X Drive!
echo.
Pause
GOTO END

:MenuTwo
echo.
echo Please select game to backup: (All selected games will be backed up to desktop)
echo.
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" echo (7.1)Burnout Paradise
echo (20)Quit
echo.

set choice=
set /p var=Please enter in your option number:
if %var% == '7.1' GOTO 'Burnout Paradise'
if %var% == '7.2' GOTO
if %var% == '7.3' GOTO
if %var% == '7.4' GOTO
if %var% == '7.5' GOTO
if %var% == '7.6' GOTO
if %var% == 'G' GOTO 'MenuTwo'
if %var% == 'H' GOTO 'Quit'

:Burnout Pradise
echo.
IF EXIST "C:\Program Files (x86)\Electronic Arts\Burnout™ Paradise The Ultimate Box\BurnoutParadise.exe" COPY "%USERPROFILE%\AppData\Local\Criterion Games\Burnout Paradise\Save\*.*" "%USERPROFILE%\Desktop\SaveGame Backup App\SaveGame Backups\Burnout Paradise\"
echo.
Burnout Paradise Saves Copied to Desktop!
GOTO MenuTwo


:Quit
GOTO END

:END


Hi all.

As soon as I press 7 at the first option menu it goes to ':ALLDes'.
can someone shed some light on what I'm doing wrong.

Gracias!

#2 Booster2ooo

Booster2ooo

    Sergeant

  • Members
  • 247 posts

Posted 30 January 2010 - 04:16 AM

Here is a fixed menu

echo.
set choice=
set /p var=Please enter in your option number:
if %var%==1 GOTO ALLDes
if %var%==2 GOTO ALLCD
if %var%==3 GOTO ALLDD
if %var%==4 GOTO ALLFD
if %var%==5 GOTO ALLGD
if %var%==6 GOTO ALLXD
if %var%==7 GOTO MenuTwo
if %var%==20 GOTO Quit


No space between %, == and the value to compare. Futhermore, no quotes are needed (neither for the value or for the Label for the GOTO). I'll let you mod the second menu ;)

#3 illwill

illwill

    Specialist

  • Sergeant Major
  • 570 posts

Posted 30 January 2010 - 10:29 AM

or if you want you can use qoutes

if "%var%" == "7" GOTO MenuTwo



#4 ROGOnafets

ROGOnafets

    Private

  • Members
  • 7 posts

Posted 30 January 2010 - 05:43 PM

Thankyou soo much guys! If the program is finished soon would you like to help me beta test? Posted Image

#5 illwill

illwill

    Specialist

  • Sergeant Major
  • 570 posts

Posted 30 January 2010 - 08:21 PM

its not a program

#6 piekiller

piekiller

    Private

  • Members
  • 8 posts

Posted 30 March 2011 - 11:29 AM

it's a script :lol: