我想推出一個bat文件或EXEPHP推出一個Windows應用程序
我試圖
system("C:\\PATH\\TO\\FOLDER\\script.bat")
system("CMD.EXE C:\\PATH\\TO\\FOLDER\\script.bat")
system("C:\\PATH\\TO\\FOLDER\\exefile.exe /S nameOfFileToCreate.txt")
system("CMD.EXE C:\\PATH\\TO\\FOLDER\\exefile.exe /S nameOfFileToCreate.txt")
system("START C:\\PATH\\TO\\FOLDER\\script.bat")
system("START C:\\PATH\\TO\\FOLDER\\exefile.exe /S nameOfFileToCreate.txt")
有了開始,我得到這個錯誤信息。其他嘗試導致頁面加載永遠!
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> WshShell.Exec<br/><b>Description:</b> The system cannot find the file specified. ' in C:\xampp\htdocs\upload.php:95 Stack trace: #0 C:\xampp\htdocs\upload.php(95): com->Exec('START C:\PROGRA...') #1 {main} thrown in C:\xampp\htdocs\upload.php on line 95
還要注意,如果包含空格(我猜測它的確如此,你的錯誤信息)。例如:'system(「start \」C:\\ Path with spaces \\ program.exe \「」);' – 2012-08-14 14:15:37
我用C:\ PROGRA〜1 \ MICRO〜2 \這樣的短路徑代替長路徑路徑 – 2012-08-14 16:20:22