1.

Solve : Problem on If exist...?

Answer»

This is my code:
QUOTE

@echo off
MODE CON: COLS=80 LINES=20
Color f0
if exist /BGMBackup/ goto :continue else goto :backup
:backup
md "BGMBackup" 2>nul
md "BGMOriginal" 2>nul
copy /b "\bgm\*" "\BGMBackup"
copy /b "\bgm\*" "\BGMOriginal"
TIMEOUT 5 >nul
if exist \BGMBackup goto :edit
:continue
Color f0
copy /b "\BGMOriginal\*" "\BGM\"
START MyLauncher.exe
TIMEOUT 16 >nul
copy /b "\bgmedit\*" "\BGM\"
COLOR f2
echo: You can now start!!
TIMEOUT 5 >nul
exit
:editado
Color f0
start MyLauncher.exe
TIMEOUT 16 >nul
copy /b "\bgmedit\*" "\BGM\"
COLOR f2
echo: You can now start!!
TIMEOUT 5 >nul
exit
I want to CHECK if the folder is there... but i don't know the code ...Quote
if exist /BGMBackup/ goto :continue else goto :backup

The line above should be expressed like this.

if exist "\BGMBackup\" (goto :continue) else (goto :backup)


Your code creates folders in the current directory but then copies file EXPLICITLY to ROOT folders. That's a recipe for failure.
Change the MD commands so they create root folders too.


Discussion

No Comment Found