Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Pipo DeClown

system() param

This topic is 5588 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
You could use ShellExecute

  
int main()
{
ShellExecute(NULL,"open","notpade.exe mydoc.txt",NULL,NULL);
return 0;
}

Share this post


Link to post
Share on other sites
quote:
Original post by Pipo DeClown
Luke, the function takes 6 parameters!!!
What the code thén?



ShellExecute(GetStdHandle(STD_OUTPUT_HANDLE), "open", "myExecutable.exe", "-param1 is_this", "C:\Space\Chocolate\etc", SW_SHOWNORMAL);


Passing null to the directory argument will result in opening the file from the current directory. Passing null to the parameter argument opens the file without passing any parameters.

I think you can use system(), but I'm not exactly sure how. Maybe the start command.

[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]

[edited by - Lektrix on March 6, 2003 1:05:02 PM]

Share this post


Link to post
Share on other sites
O sorry bout that didnt notice here try this:

    

int main()
{
ShellExecute(NULL,"open","notepad.exe mydoc.txt",NULL,NULL,SW_SHOW);
}


[edited by - Luke1 on March 6, 2003 1:06:34 PM]

Share this post


Link to post
Share on other sites
system("Start C:\Programs\Program.exe") //you have tostate the full file name


Homepage
Luck is a Horse to ride like any other...Luckily im not a gambler, I dont know how to ride.
For any total noob out there Here is a like to my tutorials, thry them out

Share this post


Link to post
Share on other sites
I think it''s someting with the ''-''sign before the parameters, but in my version of XP(Pro) it works, but on the other versions of windows(9x, Home) it doesnt work.

.lick

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!