Launching different programs depending on pc
-
- Posts: 6
- Joined: Wed Mar 12, 2008 7:08 pm
Launching different programs depending on pc
Hi all,
I really like PStart, but i'd like to choose what programs i will launch depending on pc (hostname for ex.). The Toucan (file sync program) does a similar thing...
Anybody knows another program launcher that have this option?
Any ideas?
Thanks,
I really like PStart, but i'd like to choose what programs i will launch depending on pc (hostname for ex.). The Toucan (file sync program) does a similar thing...
Anybody knows another program launcher that have this option?
Any ideas?
Thanks,
- Zach Thibeau
- Posts: 251
- Joined: Tue Nov 28, 2006 3:26 pm
- Contact:
You could always try...
ASuite should be able to do that if I remember correctly and the interface is much like PStart and will import Pstart settings too
-
- Posts: 6
- Joined: Wed Mar 12, 2008 7:08 pm
Where in asuite i can find this?
Hi thibeaz, thanks for the response.
I think Asuite doesnt have this option or i cant find it.
I think Asuite doesnt have this option or i cant find it.
I don't know what do you need this for, but what about writing a batch script that chooses which program to run based on computer name. Something like this:
LAUNCH.BAT
You have to use "start application.exe", because otherwise you're stuck with command prompt box until you close that application. Also, you can run multiple applications from single batch file.
So, you keep using pstart, but instead of linking shortcut to you app(s), you link it to this batch file. You can use relative paths (e.g. "..\notepad++\notepad++.exe"), but have to set home dir (in shortcut properties) to location of launch.bat
Hope this helps!
LAUNCH.BAT
Code: Select all
if [%COMPUTERNAME%] == [HOMECOMP] goto run_home
if [%COMPUTERNAME%] == [WORKCOMP] goto run_work
goto :eof
:run_home
:: starts application(s) for home computer
start %windir%\notepad.exe
goto :eof
:run_work
:: starts application(s) for work computer
start %windir%\calc.exe
goto :eof
So, you keep using pstart, but instead of linking shortcut to you app(s), you link it to this batch file. You can use relative paths (e.g. "..\notepad++\notepad++.exe"), but have to set home dir (in shortcut properties) to location of launch.bat
Hope this helps!
-
- Posts: 6
- Joined: Wed Mar 12, 2008 7:08 pm
Hi Gawran,
I'm using this solution since it's the best until now. But I don't like it. Supose I want to launch the same program on three (and only on these) computers. I will have to add the path three times in the batch file.
Tell the program in what pcs it has to be lauched it's easier than do the reverse. It's my opinion...
But thanks anyway!
I'm using this solution since it's the best until now. But I don't like it. Supose I want to launch the same program on three (and only on these) computers. I will have to add the path three times in the batch file.
Tell the program in what pcs it has to be lauched it's easier than do the reverse. It's my opinion...
But thanks anyway!
Why not write something like this:
Then the same code is run for all three computers (COMP1, COMP2, COMP3), and it's skipped for all other computers.
BTW, if program you launch decides about running itself, you have to run it anyway, and than the program closes itself in case it's run on a wrong computer (if I got you right), which is a waste of time. This approach is I think much faster and more flexible, and you can use it for any list of commands you wish.
Code: Select all
if [%COMPUTERNAME%] == [COMP1] goto run
if [%COMPUTERNAME%] == [COMP2] goto run
if [%COMPUTERNAME%] == [COMP3] goto run
goto :eof
:run
start %windir%\notepad.exe
goto :eof
BTW, if program you launch decides about running itself, you have to run it anyway, and than the program closes itself in case it's run on a wrong computer (if I got you right), which is a waste of time. This approach is I think much faster and more flexible, and you can use it for any list of commands you wish.
Last edited by Gawran on Fri Mar 14, 2008 5:49 am, edited 1 time in total.
-
- Posts: 6
- Joined: Wed Mar 12, 2008 7:08 pm
I don't really understand what is wanted here.
Are your programs set to run on insertion of the usb?
That's the only reason I could think that this would be a problem.
If not Qsel has the option of running different configurations by running from different directories
I'd probably set up a small autorun launcher like popsel with the options for three configurations.
Home = .\Qsel\Qsel.exe
Directory .\Qsel\Home
Work = .\Qsel\Qsel.exe
Directory .\Qsel\Work
Then you can specify which programs will be in the launcher on each PC with the click of a button
Are your programs set to run on insertion of the usb?
That's the only reason I could think that this would be a problem.
If not Qsel has the option of running different configurations by running from different directories
I'd probably set up a small autorun launcher like popsel with the options for three configurations.
Home = .\Qsel\Qsel.exe
Directory .\Qsel\Home
Work = .\Qsel\Qsel.exe
Directory .\Qsel\Work
Then you can specify which programs will be in the launcher on each PC with the click of a button
-
- Posts: 6
- Joined: Wed Mar 12, 2008 7:08 pm
Local,
I think we're not talking the same problem.
PStart has a autorun function. That is, call some programs that you choose when PStart starts. What I want is call different programs depending on the pc I'm starting PStart.
It's obvious that PStart, in that case, will be running on an usb drive.
Qsel has something like this?
Thanks,
I think we're not talking the same problem.
PStart has a autorun function. That is, call some programs that you choose when PStart starts. What I want is call different programs depending on the pc I'm starting PStart.
It's obvious that PStart, in that case, will be running on an usb drive.
Qsel has something like this?
Thanks,
Ahh, as I said this idea would be useless if atorun was needed.
Can you not, though, use a launcher as I mentioned but to start pstart with different profiles?
The worst case scenario has three different Pstart apps on your pen drive the best, three configurations launched by switches.
Basically all you would gain over the bat file is no cmd boxes on screen
Can you not, though, use a launcher as I mentioned but to start pstart with different profiles?
The worst case scenario has three different Pstart apps on your pen drive the best, three configurations launched by switches.
Basically all you would gain over the bat file is no cmd boxes on screen
- Cornflower
- Posts: 244
- Joined: Fri Aug 31, 2007 7:58 am
- Location: Canada's capital
I found a workaround.
I keep pstart.xml for my USB-only commands, that don't need changing from computer to computer.
I create a %COMPUTERNAME%.xml file for each of my computers, containing computer-specific specs. I choose a different colour icon for each
I wrote a 2-line batch file
auto.bat
PStart :: to start pstart.xml
PStart %COMPUTERNAME% :: for the specific ones
and altered the autorun.inf file
open=auto.bat
Now I get two system tray PStart icons, but it is clear to me which is which, and I get computer-specific settings.
Previously I would add two entries for each of those, but this problem has spurred it on for me. Thanks.
I keep pstart.xml for my USB-only commands, that don't need changing from computer to computer.
I create a %COMPUTERNAME%.xml file for each of my computers, containing computer-specific specs. I choose a different colour icon for each
I wrote a 2-line batch file
auto.bat
PStart :: to start pstart.xml
PStart %COMPUTERNAME% :: for the specific ones
and altered the autorun.inf file
open=auto.bat
Now I get two system tray PStart icons, but it is clear to me which is which, and I get computer-specific settings.
Previously I would add two entries for each of those, but this problem has spurred it on for me. Thanks.
What about writing an autoit script? It's pretty much built for this kind of thing and it can be compiled to a stand-alone portable EXE.
For some examples of how you'd do it...
You probably get the idea...
For some examples of how you'd do it...
Code: Select all
#NoTrayIcon ;Just for aesthetics...
#include <Array.au3>
Dim $homeComps[2]
$homeComps[0] = "HomeComputer" ;Some computer names to test for
$homeComps[1] = "2ndHomeComputer"
Dim $schoolComps[2]
$schoolComps[0] = "schoolComputer" ;Some computer names to test for
$schoolComps[1] = "other school computer"
$detectSchool = "someidentifier" ;If all the computers at your school begin with "Lincoln High" or something
$thisComp = @ComputerName ;Find the current computers name
if StringRegExp($thisComp, $detectSchool) then
run("filename") ;Run a program
run("filename", "", @SW_HIDE) ;Run a program hidden
exit ;If we've met this condition... probably a good idea to stop execution
endif
For $testComp In $homeComps
if $testComp = $thisComp then
run ;see above...
endif
Next
For $testComp In $schoolComps
if $testComp = $thisComp then
run ;see above...
endif
Next
- Devils Advocate
- Posts: 14
- Joined: Wed Jul 25, 2007 1:23 am
- Location: Perth, Australia
Hi guilhermebf
For the first time in nearly 20 years I've written a program in AutoIt for a purpose very similar to your own. On launching the program (as it's written at the moment) lets you choose your 'location' ie home or office etc. It then brings up a checklist of programs on my portable drive which can chosen and then be run. Each location menu has its own list which can be added or deleted to.
If you drop me a line, I'll flick the program & source code across. It's not the prettiest program in the world, but is exactly what I needed and may be of use to yourself. I'm happy to alter the program to suit your needs if its of assistance or you can adapt it to suit your exact purposes.
[/img]
For the first time in nearly 20 years I've written a program in AutoIt for a purpose very similar to your own. On launching the program (as it's written at the moment) lets you choose your 'location' ie home or office etc. It then brings up a checklist of programs on my portable drive which can chosen and then be run. Each location menu has its own list which can be added or deleted to.
If you drop me a line, I'll flick the program & source code across. It's not the prettiest program in the world, but is exactly what I needed and may be of use to yourself. I'm happy to alter the program to suit your needs if its of assistance or you can adapt it to suit your exact purposes.
[/img]
-
- Posts: 6
- Joined: Wed Mar 12, 2008 7:08 pm
- Devils Advocate
- Posts: 14
- Joined: Wed Jul 25, 2007 1:23 am
- Location: Perth, Australia