2017-01-12 40 views
-1

我在Windows控制檯上運行我的PHP腳本,用CMD和寫作:有沒有辦法用php.exe和友好的gui運行php文件?

[PATH to php.ext]\php.exe [path_to_file]\file.php parameter 

有什麼辦法來運行的GUI(或類似)和輸入文本的PHP文件的要求參數,而不使用瀏覽器?。事情是這樣的:

enter image description here


謝謝你們。

回答

0

Visual Basic腳本對我來說是一個有效的選項:

sub shell(cmd)  

' Run a command as if you were running from the command line 

dim objShell 
Set objShell = WScript.CreateObject("WScript.Shell") 
objShell.Run(cmd) 
Set objShell = Nothing 
end sub 

dim name 

' Ask the user for a parameter 

name = inputbox("Parameter", "Title", "") 

if name <> "" then 

' The user gave the parameter. Open the program 
' with the value the user gave. 

shell "php.exe file.php " & name 
else 
msgbox "User cancelled.", 16, "User cancelled" 
end if 
相關問題