.Bat File, File Copy/Instal

626 views Asked by At

Im making a mod pack for a game, and the install seems to confuse people for some reason, and basicly all it is, is move 1 folder, @ACMP, to a set location that should be the same for everyone, except for on x86 or 32 bit PC's (e.g. C:/Program Files(x86))

What i need is a simple .bat program to move the files in the folder that the program is in, to that certain location.

The file dir's:

The Mod Pack is going to be in a zip, they extract the zip. Inside the pack folder is 2 things: Install.Bat & @ACMP(folder) The program takes @ACMP, and moves it too: c:/Program Files/Steam/SteamApps/common/Arma 3/ OR c:/Program Files (x86)/Steam/SteamApps/common/Arma 3/

So if this can be done, i would be very thankful, And if there is way to see if the pc's running x86 or 32 bit.

Thanks!

1

There are 1 answers

7
unclemeat On

In future you need to show some evidence of having attempted to figure out the problem before asking how to do it.

Something like this should pretty much do it.

@echo off

set installdir=Steam\SteamApps\common\Arma 3\

if exist "%ProgramFiles%\%installdir%" (
    set installdir=%ProgramFiles%\%installdir%
) else (
    if exist "%ProgramFiles(x86)%\%installdir%" (
        set installdir=%ProgramFiles(x86)%\%installdir%"
    ) else (
        echo Could not find install directory & pause & goto :EOF
    )
)


echo %installdir%
copy "@ACMP" "%installdir%"
pause