how can I pass output (from cli-php) to a bat file argument, example:
@echo off
php myScript.php > %%1
rmdir /S /Q %%1
I know I may delete the file using php only.
regards,
//t
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The same way you capture the output of any command into a variable:
FOR /F %%A IN ('command') DO ...You need to set the appropriate FOR /F options to parse/preserve the value(s) you want. In this case you will likely want
"DELIMS="in case the path contains spaces.I suppose it is possible for the path to begin with a semicolon, which would cause the FOR /F to ignore the output due to default
"EOL=;". A path can’t begin with a colon, so you could set"EOL=:"just to be safe: