Page 1 of 1

Xcopy help (advance)

Posted: 02 Aug 2012 10:39
by joakim
Hi, im making an easy folder copy tool byt it dosent work, i can copy and paste the files.


but im stuck here:if %OP%==64 set dist2=%programfiles(x86)%\Minecraft else set dist2=%programfiles%\Minecraft







@echo off
cls
color 0A
title Minecraft 1.3.1 USB installer made by skillsa2
echo ===================================
echo = Please Select your USB drive =
echo ===================================
echo.
echo.
echo Please wrigt down your USB drive (only the letter)
echo.
echo Example: F, H, G, etc...
echo.
set /P "D=>>"

echo ===================================
echo = Do you have 32 or 64 bit OP? =
echo ===================================
echo.
echo.
echo 23 = 32bit OperativSystem
echo.
echo 64 = 64bit OperativSystem
echo.
set /P "OP=>>"

::==============
cd C:\Users\%username%\AppData\Roaming
md .minecraft
Set source=%D%E:\.minecraft
set dist=C:\Users\%username%\AppData\Roaming\.minecraft
::==============
cd %programfiles(x86)%
md Minecraft
Set source2=%D%:\Minecraft
if %OP%==64 set dist2=%programfiles(x86)%\Minecraft else set dist2=%programfiles%\Minecraft
::==============
cd %UserProfile%\Desktop\
if %OP%==64 set dist3=%programfiles(x86)%\Minecraft else set dist2=%programfiles%\Minecraft
set dist3=%UserProfile%\Desktop\

::==============

Xcopy "%source%" "%dist%" /E /I /H /R /Y
echo.
echo Done installing .minecraft folder to appdata!
echo.
echo.
Xcopy "%source2%" "%dist2%" /E /I /H /R /Y
echo.
echo Done installing Minecraft folder to programfiles!
echo.
echo.
Xcopy "%source2%" "%dist2%" /E /I /H /R /Y
echo.
echo Done installing Minecraft shortcut to the desktop
echo.
Xcopy "%source3%" "%dist3%" /E /I /H /R /Y
echo.
echo The installation of Minecaraft 1.3.1 is now DONE you can now play!
echo.
echo Press any key to exit the installation.
echo.
pause


i just want to copy and paste the files on an 64 and 32 bit operativsystem plz help :wink:

Re: Xcopy help (advance)

Posted: 02 Aug 2012 10:54
by abc0502
You put an option in your code to select 32/64 bit operating systems, so i sugest you use labels so make two labels one for 32bit and other for 64 bit and uder each one it's command that suite the system so you can avoid the if statement if it confuse you

Re: Xcopy help (advance)

Posted: 02 Aug 2012 11:19
by foxidrive
Try this:

if "%OP%"=="64" (set "dist2=%programfiles(x86)%\Minecraft") else (set "dist2=%programfiles%\Minecraft")

Re: Xcopy help (advance)

Posted: 02 Aug 2012 11:25
by abc0502
you have small mistakes in the code,

Code: Select all

Set source=%D%E:\.minecraft

if the %D% is the Drive letter then you should remove E

and you can make the batch identify the operating system by it self using this:

Code: Select all

IF Exist "%programfiles(x86)%" ( goto system_64
) Else ( goto system_32 )

system_32 and system_64 are labels pointing to a set of orders that depend on the system type