Xcopy help (advance)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
joakim
Posts: 24
Joined: 07 Mar 2012 12:08

Xcopy help (advance)

#1 Post by joakim » 02 Aug 2012 10:39

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:

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Xcopy help (advance)

#2 Post by abc0502 » 02 Aug 2012 10:54

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Xcopy help (advance)

#3 Post by foxidrive » 02 Aug 2012 11:19

Try this:

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

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Xcopy help (advance)

#4 Post by abc0502 » 02 Aug 2012 11:25

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

Post Reply