0

well im trying to create a bat file that calls the php-cgi.exe with the file that it has to call , and the parameter that files need:

start "C:\Program Files (x86)\php\php-cgi.exe" \\\10.101.3.21\wiki\maintenance\importimages.php C:\wikimages jpg bmp

but i cant get it to work, it tries to open the importimages file instead of running it

1 Answer 1

1

First, check which OS you're using. The syntax for the 'start' command has changed over time.

You used to be able to do

start "iexplore.exe"

Now, you have to supply the window title before the command you're starting:

start "Title Goes Here" "iexplore.exe"

This change was made sometime around Windows XP, so if you're using Vista, 7, or 8 keep that in mind.

I think what you're looking for is something like:

start "" "C:\Program Files (x86)\php\php-cgi.exe \\\10.101.3.21\wiki\maintenance\importimages.php C:\wikimages jpg bmp"
Sign up to request clarification or add additional context in comments.

2 Comments

it almost work, it gets the second command (the \\10.101.3.21), but now it isnt getting the third (i had to make some changes because it was searching all as a code start "updater" "C:\Program Files (x86)\php\php-cgi.exe" \\10.101.3.21\wikitest\maintenance\importimages.php C:\wikimages jpg bmp
This is almost certainly to do with the quoting of parameters. Try different things, but essentially you must wrap all the things that come after start "updater" in double quotes. If that still doesn't work, you may want to try wrapping php-cgi.exe's arguments in double quotes as well (probably escaped, such as start "updater" "php-cgi.exe \"param1\" \"param2\" \"param3\"".) Not on a Windows machine so I'm afraid I can't help too much at the moment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.