windows - php.exe script parameters in batch file -


i'm trying execute php script on windows through php.exe, while passing parameters script. everywhere look, says should work this:

php -f "path\to\my\script.php" -- -t 10 -i 5 

the -t 10 -i 5 should passed script.php, can access them through $argv. when type in on command line, runs expected. when paste same line in .cmd file, part after script.php gets treated seperate command. (and yes, single line in batch file)

c:\>php -f "path\to\my\script.php" -- -t 10 -i 5 <<<output of php script expected>>> c:\>mybatch.cmd c:\>php -f "path\to\my\script.php" <<<output of php script not receiving parameters>>> c:\>-- -t 10 -i 5 '--' not recognized internal or external command, operable program or batch file. 

i first thought might problem --, if leave out -- (basically passing other parameters php.exe instead of script), same problem occurs.

any ideas on why happening?

found problem, appearantly there linefeed after filename of script, not visible in notepad. no idea how got there (probably copy/paste related), removing fixed problem.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -