Page 1 of 1

using exec() function

Posted: Wed Jan 08, 2003 1:50 am
by psmshankar
Hi

when i run the following code my system either too slow and nothing coming up in the browser(expect the progress bar moving slowly at the bottom) or my system gets restarted abrubtly..
i donno whats wrong..i am just trying a sample to open up a notepad...

Code: Select all

$sCommand = "c:/windows/notepad.exe";
exec($sCommand);
i tried using "c:\windows\notepad.exe" as well as just "notepad" but nothing seems to work..
any idea where i am wrong..
i am using win/php 4/apache 1.3

Shankar

Posted: Wed Jan 08, 2003 2:05 am
by volka
notepad is a gui program that doesn't stop until it is closed. What are you trying to achieve?

Posted: Wed Jan 08, 2003 2:24 am
by psmshankar
actually i wrote a script to dump mysql data..

Code: Select all

$sPath = "c:\phpdev3\mysql3.23\bin";
$sCommand=$sPath. "\mysqldump -h".$sServerName." - u".$sUsername." -p".$sPassword." ".$dbname." > ".$DIRNAME.$dbname.".sql";
it did not produce any result and exactly same situation which i explained first...

Posted: Wed Jan 08, 2003 2:37 am
by volka
print $sCommand and enter the output in a dos-box. Does that work?
At least " - u " contains a space too much.