www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to use the std.process?

reply "FrankLike" <1150015857 qq.com> writes:
I want to start the process by std.process.

module main;
import std.process,std.stdio;
void main()
{
	string url = "http://dlang.org/";
	executeShell(escapeShellCommand("wget", url, "-O", 
"dlang-index.html"));
	executeShell("iexplore localhost:8080");
}

But not open 'IE'. Why?

Thank you.
May 13 2014
parent reply "Mengu" <mengukagan gmail.com> writes:
On Tuesday, 13 May 2014 at 08:56:43 UTC, FrankLike wrote:
 I want to start the process by std.process.

 module main;
 import std.process,std.stdio;
 void main()
 {
 	string url = "http://dlang.org/";
 	executeShell(escapeShellCommand("wget", url, "-O", 
 "dlang-index.html"));
 	executeShell("iexplore localhost:8080");
 }

 But not open 'IE'. Why?

 Thank you.
does it work when you run "iexplore localhost:8000" in command line? is path to iexplore in your windows path?
May 13 2014
next sibling parent "FrankLike" <1150015857 qq.com> writes:
 does it work when you run "iexplore localhost:8000" in command
 line? is path to iexplore in your windows path?
module main; import std.process,std.stdio; void main() { spawnProcess("C:\\Program Files (x86)\\Internet Explorer\\iexplore"); } it can work.but the args is not easy to input.
May 13 2014
prev sibling parent reply "FrankLike" <1150015857 qq.com> writes:
 does it work when you run "iexplore localhost:8000" in command
 line? is path to iexplore in your windows path?
Ok,I get the answer by myself. module main; import std.process,std.stdio; void main() { //spawnProcess("C:\\Program Files (x86)\\Internet Explorer\\iexplore"); spawnProcess(["C:\\Program Files (x86)\\Internet Explorer\\iexplore", "http://localhost:8080" ]); } :-D Frank
May 13 2014
parent reply "Mengu" <mengukagan gmail.com> writes:
On Tuesday, 13 May 2014 at 10:48:06 UTC, FrankLike wrote:
 does it work when you run "iexplore localhost:8000" in command
 line? is path to iexplore in your windows path?
Ok,I get the answer by myself. module main; import std.process,std.stdio; void main() { //spawnProcess("C:\\Program Files (x86)\\Internet Explorer\\iexplore"); spawnProcess(["C:\\Program Files (x86)\\Internet Explorer\\iexplore", "http://localhost:8080" ]); } :-D Frank
that is actually what i meant by "is path to iexplore in your windows path?" :)
May 13 2014
parent "FrankLike" <1150015857 qq.com> writes:
 that is actually what i meant by "is path to iexplore in your 
 windows path?" :)
Thank you,but it is another function,in other language ,it can work for IE.
May 13 2014