![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Oct 2006
Posts: 2
Rep Power: 0
![]() |
Need Batch Help
I am writing simple batch files for installing my mods for Star Wars Battlefront 2, but I am having a problem with it. Here is my script so far:
@echo off cls echo Hello, welcome to Darkicon's Star Wars Battlefront II mod installer! pause echo Would you like to install Civil War Elimination on Geonosis? echo Y Yes echo N No CHOICE /C:yn Choose an option. IF errorlevel 2 GOTO No IF errorlevel 1 GOTO Yes :Yes echo Deleting original "mission.lvl". del C:\Program Files\LucasArts\Star Wars Battlefront II\GameData\data\_lvl_pc\mission.lvl echo Moving Civil War Elimination on Geonosis "mission.lvl". copy C:\XL Civil War Geo\mission.lvl C:\Program Files\LucasArts\Star Wars Battlefront II\GameData\data\_lvl_pc\ pause echo All done! Have fun! :No GOTO End :End echo Goodbye! pause exit When I execute it, it just closes. Thank you. |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Try putting Quotes " " around any filename that has a space. Also searchh online for batch files that deal with
echo Y Yes echo N No CHOICE /C:yn Choose an option. IF errorlevel 2 GOTO No IF errorlevel 1 GOTO Yes |
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 824
Rep Power: 4
![]() |
Get rid of the @echo off for now and run it from the command prompt, rather than clicking the icon. That way you will get to see how far down the script it gets before it finishes and you will also see any error messages.
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
If I remember correctly 'CHOICE' only works on 9x so try using this:
set /p user=Enter Y/N IF %user% EQU N GOTO NO IF %user% EQU Y GOTO YES echo Y Yes echo N No CHOICE /C:yn Choose an option. IF errorlevel 2 GOTO No IF errorlevel 1 GOTO Yes
__________________
Pain is just weakness leaving the body.
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Oct 2006
Posts: 2
Rep Power: 0
![]() |
Wow thanks.
The new choice command and the quotes around the paths worked. Now I need help with this. It's the uninstaller. When I run it, it says it can't find the path, a bad syntax for renaming, etc. Nevermind, I just messed up where I put the quotes. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Batch Question | NightShade01 | Other Programming Languages | 3 | Jun 20th, 2006 5:39 PM |
| Embedding a batch file into a C++ app | vynkz | C++ | 22 | May 18th, 2005 8:59 PM |
| Batch Files | Skinner | Other Programming Languages | 4 | Apr 28th, 2005 8:03 AM |
| MSDOS Batch Desktop arrange | dingbat | Other Web Development Languages | 3 | Apr 13th, 2005 5:33 AM |
| Update registry key value via batch file | dpasswat | Other Scripting Languages | 1 | Mar 17th, 2005 10:45 AM |