svn: /phpdoc/en/trunk/install/windows/ commandline.xml
| From: | Richard Quadling | Date: | Thu, 27 Aug 2009 12:17:39 +0000 |
| Subject: | svn: /phpdoc/en/trunk/install/windows/ commandline.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4774@lists.php.net to get a copy of this message | ||
rquadling Thu, 27 Aug 2009 12:17:39 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=287802
Log:
Fix commandline usage of PHP on windows to allow PHP scripts to act as commandline filters.
Changed paths:
U phpdoc/en/trunk/install/windows/commandline.xml
Modified: phpdoc/en/trunk/install/windows/commandline.xml
===================================================================
--- phpdoc/en/trunk/install/windows/commandline.xml 2009-08-27 11:09:43 UTC (rev 287801)
+++ phpdoc/en/trunk/install/windows/commandline.xml 2009-08-27 12:17:39 UTC (rev 287802)
@@ -17,7 +17,7 @@
any changes to Windows.
<screen>
<![CDATA[
-C:\PHP5\php.exe "C:\PHP Scripts\script.php" arg1 arg2 arg3
+C:\PHP5\php.exe "C:\PHP Scripts\script.php" -- -arg1 -arg2 -arg3
]]>
</screen>
</para>
@@ -78,7 +78,7 @@
PHP executable. This is done by typing the running the following command:
<screen>
<![CDATA[
-ftype phpfile=php.exe "%1" %*
+ftype phpfile=php.exe "%1" -- %*
]]>
</screen>
</para>
@@ -121,7 +121,7 @@
@="&Open"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\phpfile\shell\Open\command]
-@="\"C:\\PHP5\\PHP.EXE\" \"%1\" %*"
+@="\"C:\\PHP5\\PHP.EXE\" \"%1\" -- %*"
]]>
</screen>
</example>
@@ -131,22 +131,48 @@
With these changes the same command can be written as:
<screen>
<![CDATA[
-"C:\PHP Scripts\script" arg1 arg2 arg3
+"C:\PHP Scripts\script" -arg1 -arg2 -arg3
]]>
</screen>
- </para>
-
- <para>
- There is a small problem if you intend to use this techique and use your
- PHP scripts to act as a filter. You must use the complete version above.
+ or, if your <literal>"C:\PHP Scripts"</literal> path is in the
+ <literal>PATH</literal> environment variable:
<screen>
<![CDATA[
-dir | "C:\PHP Scripts\script" arg1 arg2 arg3
+script arg1 arg2 arg3
]]>
</screen>
- The above command line will not work. This seems to be a limitation of
- the command processor in Windows.
</para>
+
+ <note>
+ <para>
+ There is a small problem if you intend to use this techique and use your
+ PHP scripts as commandline filters, like the example below:
+ <screen>
+<![CDATA[
+dir | "C:\PHP Scripts\script" -arg1 -arg2 -arg3
+]]>
+ </screen>
+ or
+ <screen>
+<![CDATA[
+dir | script -arg1 -arg2 -arg3
+]]>
+ </screen>
+ You may find that the script simply hangs and nothing is output.
+ To get this operational, you need to make another registry change.
+ <screen>
+<![CDATA[
+Windows Registry Editor Version 5.00
+
+[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer]
+"InheritConsoleHandles"=dword:00000001
+]]>
+ </screen>
+ Further information regarding this issue can be found in this <link
+ xlink:href="http://support.microsoft.com/default.aspx?scid=kb;en-us;321788">Microsoft
+ Knowledgebase Article : 321788</link>.
+ </para>
+ </note>
</sect1>
<!-- Keep this comment at the end of the file