1

I want to start c:...\php.exe and add the argment c:...\upload.php"

into my batch file but anytime I do it it says wrong Paramter.

I even tried setting an argument by saying:

@echo off
set arg1=%1


start ""c:\...\php.exe" %1"c:\...\upload.php"%1" 

still wont work, thanks in advance guys.

2 Answers 2

2

There is a whole section of the manual dedicated to command line usage. Usually though, you would just specify several arguments as space separated after the script name and you can access them in your script with $argv. Example:

<?php print_r($argv); ?>

then run with

php.exe test.php test1 test2
Sign up to request clarification or add additional context in comments.

Comments

1

You've got mis-matched quotes. They're only necessary if the window title and/or command path have spaces in them. Try

start "" "c:\...\php.exe" "c:\...\upload.php"
      ^^---window title
         ^^^^^^^^^^^^^^^^--- command
                          ^^^^^^^^^^^^^^^^ argument

Comments

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.