I have a problem with a batch file. No that statement is wrong, my .bat works fine but when I convert it to a exe I get errors.
My code is underneath.
You can skip the first lines untill you get to the echo of 2 paths. All the rest above it is simply the searching of both paths and checking if they're correct. Then I made a switch, to copy from path A to B or B to A and a delete statement to delete A. The delete works fin,
but when I use the first xcopy in a exe I get this:
file not found - cmdlnMYDOCPATH.
when I use the second xcopy in a exe I get this:
file not found - cmdlnCURRENT.
I know there's a similarity between these two errors, the path of the destination ofcourse but I don't see what the file is doing wrong or how to fix it.
EDIT: using version 184.108.40.206, although the splash screen says 220.127.116.11 .....
Can you guys and gals help me out?
Thx in advance!
Code: Select all
@ECHO off for /f "tokens=1-2*" %%A in (' REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" ') do if "%%A"=="AppData" set MYDOCPATH=%%C echo This user's document roaming is: %MYDOCPATH% set CURRENT=%~dp0 set CURRENT=%CURRENT%SAVE\ c: cd %MYDOCPATH% cd.. set MYDOCPATH=%CD% set MYDOCPATH=%MYDOCPATH%\Local\Criterion Games\Burnout Paradise\ echo %MYDOCPATH% echo %MYDOCPATH% echo %CURRENT% :start ECHO. ECHO 1. Save to Hard Disk ECHO 2. Save to Removable Drive ECHO 3. Remove from Hard Disk set choice= set /p choice=Type the number select your choice. if not '%choice%'=='' set choice=%choice:~0,1% if '%choice%'=='1' goto hello if '%choice%'=='2' goto bye if '%choice%'=='3' goto deleting ECHO "%choice%" is not valid please try again goto start :hello XCOPY "%CURRENT%*.*" "%MYDOCPATH%" /Y /C /I /E /D /S goto end :bye XCOPY "%MYDOCPATH%*.*" "%CURRENT%" /Y /C /I /E /D /S goto end :deleting rmdir /s /q "%MYDOCPATH%" goto end :end