Execute a programm with arguments?

BlitzMax Forums/BlitzMax Beginners Area/Execute a programm with arguments?

danvari(Posted 2007) [#1]
hello!

yes, the title sais it all. is it possible to run an executable with arguments...for example "server.exe 2 127.0.0.1"....
the openurl command does not work when arguments are enabled..it has to be a system-independent solution...i think it might work with freeprocess, but i did not find any useful examples, rather than documentation :-\...

thank you!


H&K(Posted 2007) [#2]
Execute a programm with arguments?

Global AppArgs$[]="bbAppArgs"

Description:
Arguments passed to the application at startup
Information The AppArgs global array contains the command line parameters sent to an application when it was started. The first element of AppArgs always contains the name of the application. However, the format of the name may change depending on how the application was launched. Use AppDir or AppFile for consistent information about the applications name or directory.


So I would guess err... ;)


danvari(Posted 2007) [#3]
oh no ;) i think these are the arguments that are passed to the application (in my case: the server). but i want to execute a program with arguments (in my case: the client starts the server with arguments).


Azathoth(Posted 2007) [#4]
Doesn't openurl open the web browser?


danvari(Posted 2007) [#5]
no openurl opens an URL (default web browser), EXE or folder (default explorer). give it a try:

OpenURL("C:\Windows\Notepad.exe")


Dreamora(Posted 2007) [#6]
There is as well system_ and pub.freeprocess which can be used :)


danvari(Posted 2007) [#7]
are there any documentations out there?


Dreamora(Posted 2007) [#8]
On what?
The module above is documented
system_ is theoretically an internal command but does the same as execfile in blitz3d and blitzplus if you need docs


danvari(Posted 2007) [#9]
uh, sorry, but where is freeprocess documentated? in blitzmax, under pub.mod/freeprocess.mod/ there i can find "doc" "freeprocess.bmx" and "freeprocess.c" but when i double click on "doc" nothing happens :-\.


andre72(Posted 2007) [#10]
Have a look here I think this is a sample for is need for:
http://www.blitzmax.com/Community/posts.php?topic=68847#769849


danvari(Posted 2007) [#11]
thank you :) but i think it might be quite useful, especially for new users, if there are any docs out there...also for third party modules....i know that third p. mods might have change to the next sync, but... :-\