[TC] Gaming Forums
[TUTORIAL] Create a BAT file to launch several programs - Printable Version

+- [TC] Gaming Forums (https://forum.city-driving.co.uk)
+-- Forum: General Information (/forumdisplay.php?fid=1)
+--- Forum: General Discussions (/forumdisplay.php?fid=4)
+---- Forum: Tutorials & Guides (/forumdisplay.php?fid=48)
+---- Thread: [TUTORIAL] Create a BAT file to launch several programs (/showthread.php?tid=19146)

Pages: 1 2


Create a BAT file to launch several programs - Ash - 2015-08-15 19:22

As requested, I have made a small tutorial on how to make a simple .bat file which will launch several programs at the click of a shortcut.

1. Open a fresh Notepad file and save it in your LFS area, calling it something like "RunLFS.bat". Make sure you select the save as type as "All Files (*.*)" else this will not work.

This is an example of my RunLFS.bat file, make the adjustments to your specific needs! Smile

Code:
@echo off

start /d "C:\Program Files\Logitech Gaming Software" LCore.exe
start /d "C:\Program Files\Logitech\Gaming Software" LWEMon.exe
start /d "C:\Users\Ash\LFS" LFS.exe

As you can see, I have mine set to launch Logitech Profiler, Logitech Keyboard Profiler and LFS itself.

Explanation:

The other lines are the executables which I wish to launch. You can see there are 2 main parts. The file LOCATION and the EXECUTABLE itself. You need to have the LOCATION within the speech marks and the EXECUTABLE outside of them.

I then found the actual file itself which I saved in my LFS directory, and send it to the desktop as a shortcut and changed the icon to match LFS's own one.

[Image: 2hro95i.png]

[Image: 6sc8c2.png]
Hope this helps, if your stuck, reply and ill give you a hand! Smile - PS Remember to save your file when doing your changes!


RE: [TUTORIAL] Create a BAT file to launch several programs - Carl - 2015-08-15 20:25

Very nice tutorial, Ash. Thanks for posting!

This may sound like a dumb question, but can I use this method to connect to servers? Using the server IP as the location?


RE: [TUTORIAL] Create a BAT file to launch several programs - Ash - 2015-08-15 20:27

Here you go...

Replace
Quote:start /d "C:\Users\Ash\LFS" LFS.exe

with

Quote:@start lfs://join=[TC]%%20CityDriving%%20One



RE: [TUTORIAL] Create a BAT file to launch several programs - Carl - 2015-08-15 21:42

Thank you! Smile

There is a part which is a little confusing, does the .bat replace the original lfs.exe?


RE: [TUTORIAL] Create a BAT file to launch several programs - Ash - 2015-08-15 21:54

Noo the .bat file is pretty much a 'Shortcut'. Keep the lfs.exe or you wont be able to play your game lol.

The .bat is simply a script which runs commands. Somewhat like LFS Scripts Smile


RE: [TUTORIAL] Create a BAT file to launch several programs - Otava - 2015-08-16 06:54

What about putting timer between programs cue to LFS Lazy puts insim automatically 29999 but Mary is saying error before it?


RE: [TUTORIAL] Create a BAT file to launch several programs - Val - 2015-08-16 07:40

2 methods to make a timer, simply add one of these in the file :

1) The timeout command :

timeout /T 1 /nobreak

/T number = set time (in seconds)
/nobreak = ignore key press so it won't interrupt the timer if you press a key.

2) You can "make" a timer by pinging an invalid IP address :

ping 1.2.3.4 -n 1 -w 1000 >NUL

-n number = number of request to send (leave it to 1)
-w number = delay in milliseconds (1000 = 1 sec)


RE: [TUTORIAL] Create a BAT file to launch several programs - Otava - 2015-08-16 09:08

Can I make BAT file to press for example f7?
Thaks Val for response Smile


RE: [TUTORIAL] Create a BAT file to launch several programs - Toni - 2015-08-16 09:44

This thread is over my nerd level.

Might try this, need to start TurnsigV0.3, LFSlazy, LFSstrobe, etc stuff.


RE: [TUTORIAL] Create a BAT file to launch several programs - Val - 2015-08-16 10:20

(2015-08-16 09:08)Otava Wrote:  Can I make BAT file to press for example f7?
Thaks Val for response Smile

Do you want a .bat script which press the F7 key or do you want to execute a .bat file by pressing the F7 key ?


RE: [TUTORIAL] Create a BAT file to launch several programs - Otava - 2015-08-16 16:15

I said to, not by Smile But now the problem is solved and I dont need to so Thanks for response Smile


RE: [TUTORIAL] Create a BAT file to launch several programs - Otava - 2015-08-16 16:44

One thing still, can I make LFS Strobe to load the settings automatically


RE: [TUTORIAL] Create a BAT file to launch several programs - Otava - 2015-08-16 17:46

Uuuh, that took me a long time.
If anybody wants a files what I use to start now just PM me or post here, it puts port automatically (needs 1 bind slot) and starts LFS and/or TC, LFSLazy, Mary and LFSStrobe with settings


RE: [TUTORIAL] Create a BAT file to launch several programs - Wouter - 2015-08-23 10:12

I use a .bat-file to start LFS and other programs like Mary for months. It's worth it, because i can start everything with one file now!


RE: [TUTORIAL] Create a BAT file to launch several programs - VirtualTourist - 2015-08-23 11:11

Or just use autoexec.lfs script.

/insim 29999

/exec Mary.exe
/exec LFSLazy.exe

Edit: Hmm I see. You guys are a next level nerdy. Smile


RE: [TUTORIAL] Create a BAT file to launch several programs - Wouter - 2015-08-25 14:35

@virtualtourist, i use that in combination with a .bat-file that makes a back-up of the message-log of the last session.


RE: [TUTORIAL] Create a BAT file to launch several programs - Otava - 2015-11-08 14:46

Sharing how I use this
Main batch
LFS-TC.bat Wrote:@echo off

@start lfs://join=[TC]%%20CityDriving%%20One
ping 1.2.3.4 -n 1 -w 3000 >NUL
start /min /d "C:\Users\Onni\Desktop\Pelit\LFS\LFS Shortcut" F7.vbs
ping 1.2.3.4 -n 1 -w 1500 >NUL
start /min /d "C:\Users\Onni\Desktop\Pelit\LFS\" LFSLazy
start "" /min "C:\Users\Onni\Desktop\Pelit\LFS\LFS Strobe\LfsStrobe.exe" "C:\Users\Onni\Desktop\Pelit\LFS\LFS Strobe\Yea.txt"
start /min /d "C:\Users\Onni\Desktop\Pelit\LFS\Mary\Mary" Mary
and the "F7.vbs"
F7.vbs Wrote:Set oShell = CreateObject("WScript.Shell")
oShell.AppActivate "Live For Speed"
oShell.SendKeys "^{F7}"
Hopefully someone found this useful


RE: Create a BAT file to launch several programs - Wouter - 2015-12-03 15:15

I use .bat-files and LFS Scripts for about a half year, and it's worth the pain!


RE: Create a BAT file to launch several programs - HellaFlush - 2016-01-10 22:38

So I had this for quite a while now, but my question is, how to turn this off?, my LFS Lazy is broken so it won't connect to port 29999, and I want to change this, but I can't find the .bat file I made like a year ago..

Here is a screenshot of my LFS folder.

[Image: 27f62ba3d1.png]

Thanks in advance.


RE: Create a BAT file to launch several programs - Ash - 2016-01-10 22:44

(2016-01-10 22:38)HellaFlush Wrote:  So I had this for quite a while now, but my question is, how to turn this off?, my LFS Lazy is broken so it won't connect to port 29999, and I want to change this, but I can't find the .bat file I made like a year ago..

Here is a screenshot of my LFS folder.

[Image: 27f62ba3d1.png]

Thanks in advance.

Well you use the .bat file to launch LFS right? If its a shortcut, right click it and find the destination area through the properties.