开发者

How do you make this batch file work in vista?

Oo so I have created a batch file. it works fine in windows 7 but when i tested in vista it still works but it skips the :DELETE label it will go straight to :BEGIN label help please? , thanks for your time.

:: Batch file Created By Ookami
::
:: Copyright (c) 2011 NearFang™
::
:: Facebook: http://www.facebook.com/00k4MI
::
:MAIN
@ECHO OFF
mode con:cols=43 lines=10
color 5B
title MCTool

echo %~n0%~x0 started from Directory: %~d0%~p0 > nul
%~d0
cd %~d0%~p0

:Menu
echo MC Batch Tool Copyright (c) 2011 Ookami.
echo -----------------------------------------
echo [OPTIONS]:
echo =========================================
echo [1]Run minecraft installer
echo [2]Restore .minecraft
echo =========================================
set /p choice=Enter Option:
if %choice% == 1 goto 1
if %choice% == 2 goto 2
GOTO Menu

:1
IF NOT EXIST .minecraft GOTO ERROR2
IF NOT EXIST %APPDATA%\.minecraft GOTO BEGIN
IF EXIST %APPDATA%\.minecraft GOTO DELETE
IF EXIST .minecraft GOTO BEGIN

:BEGIN
XCopy ".minecraft" "%appdata%\.minecraft" /开发者_运维技巧S /E /I /Y
cls
echo Pre-Modded minecraft installed...
echo.
pause
EXIT

:DELETE
cls
echo An existing .minecraft folder was found!
echo.
echo Create backup, before deletion?
SET /P input=Yes or No (Y/N):
IF '%input%' == 'Y' (
GOTO BACKUP
)
IF '%input%' == 'y' ( 
GOTO BACKUP
)
IF '%input%' == 'N' ( 
GOTO DELNOW
)
IF '%input%' == 'n' ( 
GOTO DELNOW
) ELSE (
GOTO ERROR
)

:BACKUP
IF EXIST mcbak\.minecraft RD mcbak\.minecraft /S /Q
XCopy "%appdata%\.minecraft" "mcbak\.minecraft" /S /E /I /Y /Q
cls
echo Copied Folder To: 
echo.
echo %~d0%~p0
echo.
echo successfully completed!
echo.
pause
cls
echo starting deletion process...
RD /S /Q "%APPDATA%\.minecraft"
echo.
echo .minecraft folder has been Deleted
echo.
pause 
cls
echo Now installing Pre-Modded minecraft folder
XCopy ".minecraft" "%appdata%\.minecraft" /S /E /I /Y /Q
echo.
echo successfully completed...
echo.
pause
EXIT

:DELNOW
cls
echo Starting Deletion Process...
RD /S /Q "%APPDATA%\.minecraft"
echo.
echo .minecraft folder has been Deleted
echo.
pause 
cls
echo Now installing Pre-Modded minecraft folder
XCopy ".minecraft" "%appdata%\.minecraft" /S /E /I /Y /Q
echo.
echo successfully completed...
echo.
pause
EXIT

:ERROR
echo.
echo Your input was invalid
echo.
PAUSE
GOTO DELETE

:ERROR2
cls
echo .minecraft folder was not found!
echo.
echo Note: mctool must be next to .minecraft
echo.
PAUSE
EXIT

:2
IF NOT EXIST mcbak\.minecraft GOTO noget
IF NOT EXIST %APPDATA%\.minecraft GOTO nowget
IF EXIST %APPDATA%\.minecraft GOTO DELNOW
IF EXIST mcbak\.minecraft GOTO nowget

:nowget
XCopy "mcbak\.minecraft" "%appdata%\.minecraft" /S /E /I /Y
cls
echo Minecraft has been Restored successfully
echo.
pause
exit

:DELNOW
cls
RD /S /Q "%APPDATA%\.minecraft"
GOTO nowget

:noget
cls
echo No backups found or have been created 
echo.
echo Note: mctool must be next to mcbak folder
echo.
pause
exit


Try to put %appdata inside quotes, like this: IF EXIST "%APPDATA%"\.minecraft GOTO DELETE.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜