Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running another program 1

Status
Not open for further replies.

pwu

Programmer
Jun 27, 2000
3
US
I'm programming Perl in Win32 environment.<br>I've tried to run another program by using the system()<br>But sometime it's working, sometimes not.<br>example:<br>&nbsp;<br>&nbsp;&nbsp;system(&quot;notepad.exe&quot;);&nbsp;&nbsp;#working<br>&nbsp;&nbsp;system(&quot;Excel.exe&quot;);&nbsp;&nbsp;&nbsp;&nbsp;#working<br>&nbsp;&nbsp;system(&quot;AcroDist.exe&quot;); #not work<br>&nbsp;&nbsp;<br>I even specified the file path for the &quot;AcroDist.exe&quot;<br>program, but it still doesn't work.&nbsp;&nbsp;I feel this function<br>only works for Microsoft applications. If you have any<br>solution, please let me know.... Thank you so much.<br>
 
I have found what the problem is, thank you <br>for read my question<br><br>solution:<br><br>use this (cause the path got space)<br>system(&quot;\&quot;d:\\program files\\distillr\\AcroDist.exe\&quot;&quot;);<br><br>not this<br>system(&quot;d:\\program files\\distillr\\AcroDist.exe\&quot;);
 
Are u in the right directory when running the program?<br>I tried spawning a child process and it worked for me.<br>like:<br><br><br>chdir('c:\program files\perl builder');<br>system('pbuilder.exe');<br>
 
Thank you! Oinkers, your tip works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top