Welcome, Guest. Please Login or Register.
eccoMAGIC Forums
05/03/24 at 10:45:37
News: Welcome to the eccoMAGIC forum.
Home Help Search Login Register


Pages: 1
Send Topic Print
emSpawn to launch webpage? (Popularity: 8878 )
rb
Senior Member
****


I Love Ecco!

Posts: 88
Show the link to this post emSpawn to launch webpage?
05/29/09 at 03:20:48
 
I am trying to launch a URL from LUA and using emSpawn:
 
os.execute("emSpawn.exe /! http://msn.com")  
 
Why do I need to close the DOS window before the Browser launches the page? I just want the page to open in the Browser...
Back to top
 
 
  IP Logged
Admin
Administrator
*****


I love Ecco!

Posts: 134
Show the link to this post Re: emSpawn to launch webpage?
Reply #1 - 05/29/09 at 06:48:48
 

good question.
 
 
 
have not tested,  so fill me in.
 
 
What dos window ?
 
 
if you test from cmd line,  for example,  works fine ?
 
 
just from the LUA execute is opening a dos window ?
 
 

does a "exit && emSpawn.exe ....etc..." do any better ?

Back to top
 
 

The Administrator.
WWW   IP Logged
rb
Senior Member
****


I Love Ecco!

Posts: 88
Show the link to this post Re: emSpawn to launch webpage?
Reply #2 - 05/29/09 at 12:25:13
 
With DOS window, I meant the Command window (cmd.exe).
 
Best explained with examples:
 
1.
os.execute("notepad.exe")  
=> Opens a cmd window and Notepad. However, LUA is halted until notepad closed
 
2.
os.execute("emSpawn.exe / notepad.exe")  
=> Doesn't work . I only get 2 cmd windows that opens/closes
 
3.
os.execute("emSpawn.exe /! notepad.exe")  
=> Almost works as expected. Opens and closes a cmd window (unexpected), and then opens Notepad
 
 
 
Now, I would like to open a URL instead of Notepad.
 
4.
os.execute("emSpawn.exe /! http://msn.com")  
=> Cmd window opens and execution halted. I need to close the window before the Browser URL is launched and execution continues
 
How would I open the Browser URL w/o having to close the cmd window?
 
Notes:
 
1. Not sure how to open a URL from cmd promt? Simply typing the URL doesn't work (actually surprised that  example 4 works at all)
 
2. However, I can open a URL from Windows Start|Run by simply typing the URL
 
3. 1. I don't understand what you mean by  
does a "exit && emSpawn.exe ....etc..." do any better ?  
Back to top
 
 
  IP Logged
rb
Senior Member
****


I Love Ecco!

Posts: 88
Show the link to this post Re: emSpawn to launch webpage?
Reply #3 - 05/29/09 at 22:10:29
 
Quote from rb on 05/29/09 at 12:25:13:
With DOS window, I meant the Command window (cmd.exe).

1. Not sure how to open a URL from cmd promt? Simply typing the URL doesn't work (actually surprised that  example 4 works at all)


To answer my own question:
 
start http://msn.com launches the URL in the Browser from cmd prompt.
 
Furthermore,
os.execute("start firefox.exe http://msn.com")
 
Opens the URL in the Browser w/o the need for emSpawn.exe
 
The cmd windows still opens briefly. Not sure if there is a way to hide this?
Back to top
 
 
  IP Logged
Alec_Burgess
EccoMagic Apprentice
*


We all Love Ecco!

Posts: 0
Gender: male
Show the link to this post Re: emSpawn to launch webpage?
Reply #4 - 05/29/09 at 23:19:36
 
Quote from rb on 05/29/09 at 22:10:29:
Quote from rb on 05/29/09 at 12:25:13:
With DOS window, I meant the Command window (cmd.exe).

1. Not sure how to open a URL from cmd promt? Simply typing the URL doesn't work (actually surprised that  example 4 works at all)


To answer my own question:

start http://msn.com launches the URL in the Browser from cmd prompt.

Furthermore,
os.execute("start firefox.exe http://msn.com")

Opens the URL in the Browser w/o the need for emSpawn.exe

The cmd windows still opens briefly. Not sure if there is a way to hide this?

 
Have you tried "start /b"?
From WinXP Help "Command-line reference A-Z"
Quote:
Start
/b
Starts an application without opening a new Command Prompt window. CTRL+C handling is ignored unless the application enables CTRL+C processing. Use CTRL+BREAK to interrupt the application.

Back to top
 
 

Regards ... Alec
Email   IP Logged
rb
Senior Member
****


I Love Ecco!

Posts: 88
Show the link to this post Re: emSpawn to launch webpage?
Reply #5 - 05/30/09 at 00:33:33
 
Just tried your suggestion:
os.execute("start /b firefox.exe http://msn.com")    
Still get the cmd window opening and closing.
 
Btw, I am executing the LUA command in EccoExt Expression Evaluate (opens by ctrl-alt-k)
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print