Forum virtualnega letalstva Slovenije http://www.kvls.si/forum/ |
|
Zagon več programov na enem računalniku... http://www.kvls.si/forum/viewtopic.php?f=25&t=958 |
Stran 1 od 1 |
Avtor: | Gorchi [ 28 Apr 2005, 13:49 ] |
Naslov prispevka: | Zagon več programov na enem računalniku... |
Tema je v originalu tukaj: http://www.flightdecksolutions.com/forum/viewtopic.php?t=1099 ======================================== Although this is a hardware forum, the software interface side of things is integrally related, so I believe this is a helpful place to put this. I received a question regarding autostarting of flight-sim realted apps, so here's my response for the benefit of all: Just about every flight simmer requires the ability to have multiple applications open automatically on startup and in a particular order - either on a MSFS server or client PC. You can do this two ways - the first way everybody knows:
A .bat file is just a text file that tells windows what to do line by line. Don't be put off thinking this is too technical or for programmers only - it really isn't - for builders with full decks and multiple client PCs, I imagine this will be a necessity. For flightsim purposes, we just need one to launch programs in a particular order, and in some cases pause for a bit inbetween. Here's how do exactly this: First, create a new text file - lets put it in C:\temp\ and name it something like "simLaunch.bat" - ignore window's warning about changing the file extension - no danger at all. There are just three 'commands' that we need for our purposes - they are: 'echo' - outputs a message 'start' - launches a program and keeps going 'call' - launches a program and waits until it's closed before continuing Although there are a dozen or so different commands, we only need these for our purposes. Right-click on your new bat file and click 'Edit' - this will open the file using 'notepad'. Now simply enter a line for each thing you want the batch file to do by entering the 'command' followed by a space followed by the 'parameter'. In the case of 'echo', the parameter will be the message you want to output, and in the case of 'start' the parameter will be the path to the program. Easy! Here's an example: Koda: echo starting wideClient start C:\wideFS\wideClient.exe echo starting PMSystems start C:\pmSystems\pmsystems.exe echo starting MCP start C:\MCP\mcp.exe Make your own to open some programs you have and give it a test now by just double-clicking the bat file. The bat will execute in a command prompt, and then close automatically once finish. All fine and good - everything executes immediately with no delay, but what if we want to pause and wait for a bit before opening the next program? An example of the need for this might be if we wanted to make sure that PMSystems was the last application to open, thus making it the application with 'focus' and the recipient of subsiquent keystrokes (from an encoder or keyboard). There is a simple program called 'sleep.exe' which you can get here: http://www.computerhope.com/download/utility/sleep.exe Download it (5kb) and put in your C:\windows directory. The sleep.exe program takes a parameter that specifies how many seconds to 'sleep' for before closing itself - perfect for our needs. Now you recall that the 'call' command waits until the program has finished before continuing to the next line in the batch file, so with that in mind, we can 'call' the sleep program followed by the number of seconds to wait, effectively 'pausing' the batch file while the other programs load. So: Koda: call C:\windows\sleep.exe 45 will put a 45 second pause into the batch file. Now here's an expansion on the first example using sleep: Koda: echo starting wideClient
start C:\wideFS\wideClient.exe echo sleeping for 5 seconds call C:\windows\sleep.exe 5 echo starting PMSystems start C:\pmSystems\pmsystems.exe echo sleeping for 10 seconds call C:|windows\sleep.exe 10 echo starting MCP start C:\MCP\mcp.exe Finally, once you have your batch file operating as you require, just drop a shortcut to it (or even the .bat file itself if you want) into your C:\Documents and Settings\<userName>\Start Menu\Programs\Startup and there you have it! They can be even better - I have been able to create a bat file that open seven flight sim realted apps on my flight-sim server, in a particular order, over a period of three minutes (waiting for MSFS to open etc.) and call a truVoice.exe to have an artificial voice speak what it is about to do and wish me a good flight when it is finished - all with a single double-click - you get the picture. If you'd like to find out more just google batch files - there's a lot of imfo out there. I hope this helps some of you. If you have any further questions I'm more than happy to help. -Timh |
Avtor: | Gorchi [ 28 Apr 2005, 13:51 ] |
Naslov prispevka: | |
Frans napisal/-a: Just a note...
Isnt this all standard in Widefs under the RUN command ect? gr. Frans M _________________ Frans M http://www.airbus320.nl |
Avtor: | Gorchi [ 28 Apr 2005, 13:55 ] |
Naslov prispevka: | |
Frans napisal/-a: Hi Tim,
Dont want to say that your batch files will not work but maybe this is much easer.... You can use the RUN ect. option in Widefs or you can downlaod a freeware prog at the same site where Widefs/FSUIPC can be downloaded that is called FSUIPCRunOption.zip here are also other handy small progs for the FS that can be used Or direct link here... http://www.schiratti.com/files/dowson/FSUIPCRunOptions.zip Lot of info about Run/close ect can be found in the Forum there as well. gr. Frans M _________________ Frans M http://www.airbus320.nl |
Avtor: | Gorchi [ 28 Apr 2005, 13:55 ] |
Naslov prispevka: | |
dnoize napisal/-a: and dont forget the RunReady function wich makes WideFS wait for flightsimulator to start before WideFS launches the PM programs.
(to be more precise, WideClient will wait for PM to start till its connected to WideServer, ie will wait till FS is booted up) Stef _________________ http://www.boeing737ng.com - the 737 simulator project |
Stran 1 od 1 | Vsi časi so UTC + 1 ura [ DST ] |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |