Minimizers, kill trackers, programs you use, post them here.
 #41804  by jawfin
 
Batch files are very powerful, they were once the primary interface to the Disk Operating System.
In other words, they were like the mouse is to windows, you don't need to use a mouse, but why wouldn't you?
The Disk Operating System was the whole interface to the PC before Windows was developed; it is now just that console box you see when you run 'Command Prompt' (cmd.exe).

So a batch is just that, a list of commands for the Operating System to follow. You can have conditionals, loops, parse files and directories, variables and command-line parameters, but for this purpose we are going to use it to launch multiple applications.

For a full list of commands (for the curious) go into a command prompt and type 'help'; also type 'exit' to close the console.

To launch multiple applications I'm using the start command, the reason being is because start will execute the next batch command without waiting for the first one to terminate.

So, copy the code below, paste it into notepad and save the batch file in a convient location, calling its name 'JKA.BAT' or something meaningful; but the extention (the last 4 characters) have to be '.BAT'.
Code: Select all
start /D"C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\" JKAdmin.exe 
start /D"C:\Program Files\Ultra Utility\Beta 16\" BFUUv3B-16.exe 
start /D"C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData" jamp.exe +set fs_game japlus +exec kr1
Due to word-wrap there may appear to be 4 or more lines, but there is only 3 in this code and copy/paste should only create 3.

You can edit the batch file later by Right-Clicking it and selecting 'edit'.


Possible problems/fixes
Saving JKA.BAT may create a textfile
Actually JKA.BAT.TXT although you won't see the .TXT part and that is because Windows is set (and very stupidly by default) to hide extensions of known filetypes. To fix, open 'My Computer' or any explorer window, on the top menu 'Tools' -> 'Folder Options' ; the 'View' tab and uncheck the Setting called 'Hide extensions for known file types'.

The icon is an ugly cog in a box, yup thats locked
But what we can do is save jka.bat in 'C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\' then Right-Click -> Send To -> Desktop (create shortcut). Go to the desktop and rename the file to suit, then Right-Click -> Properties, click Change Icon button and paste this text (excluding quotes) into the 'Look for icon in this file:' editbox: "C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\JediAcademy.exe" and press enter. You can in fact use any icon from any executable that you like.


Sorry for the long post, and I'll edit this post to keep it up to date.
Last edited by jawfin on Sat Sep 13, 2008 1:05 am, edited 1 time in total.

 #41832  by BadWolf
 
im having trouble with it not execing JA+ automatically
@_@
start /D"C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\jkadmin" jkadmin.exe
start /D"C:\Documents and Settings\Owner\Desktop\Matts files\BFUUv3" BFUUv3B-16.exe
start /D"C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData" jamp.exe +set fs__game japlus +exec KRSS
what am i doin wrong T.T

 #42730  by jawfin
 
Adding some oomph to this batch file so we can designate which server we want to connect to automatically.
Code: Select all
@echo off
start /D"C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\" JKAdmin.exe 
start /D"C:\Program Files\Ultra Utility\Beta 16\" BFUUv3B-16.exe 
cls
echo.
echo Select Server to Automatically Join
echo ===================================
echo.
echo 0: No Server
echo 1: KR 1
echo 2: KR 2 SafeHaven
echo 3: KR 3 Zabusa
echo.
echo.
set srv=
choice /c:0123 /n Select Server : 
if errorlevel 2 set srv=+connect kr1.knights-reborn.org
if errorlevel 3 set srv=+connect kr2.knights-reborn.org
if errorlevel 4 set srv=+connect 208.43.49.160:29070
start /D"C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\" jamp.exe +set fs_game japlus %srv%
set srv=
Once you understand the choice command being used here, you can modify the batch file to add your own servers.

Also if you are using a script to do the actual connection so you can automatically maintain your passwords on whatever server you are going to, change the connect command to the exec command. So then the KR public server connect command would look like
Code: Select all
if errorlevel 2 set srv=+exec kr1


If you desire to connect automatically to a server without having to pick an option, you can use the /T parameter such that
Code: Select all
choice /c:0123 /n /t:1,10 Select Server : 
will choose option '1: KR 1' after a 10 second wait if no keys are pressed.

 #48214  by BadWolf
 
hey i added TS to my BAT file and it works ok, but is there a way i can connect to KR TS server with the BAT?

 #48218  by jawfin
 
Hey mate, edit the batch file and put in as a command line parameter this
Code: Select all
208.43.15.2:9013/nickname=nickname
So, my batch file has this in it
Code: Select all
start /D"C:\Program Files\Teamspeak2_RC2\" TeamSpeak.exe 208.43.15.2:9013/nickname=Jawfin


Or, if u are running TS from a shortcut, change the Target to
Code: Select all
"C:\Program Files\Teamspeak2_RC2\TeamSpeak.exe" 208.43.15.2:9013/nickname=nickname

 #48226  by Kakashi.Archive
 
Jawfin wrote:echo 3: KR 3 Zabusa
doesnt exist anymore :P (last i knew o.O)

 #48233  by BadWolf
 
thanks jawfeh :D