Есть тут проблема. Наверняка она уже не один раз встречалась и решалась, но увы найти не смог.
Из PHP я вызываю exe-шник через system(ну и через exec тоже пробывал). При пути типа
system("C:\TMP\EFANEAN.txt",$rval); все работает, а при
system("'C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe",$rval); не отрабатывает и $rval со значением 1 возвращается.
Т.е. все дело в пробелах. Как быть?
Заранее спасибо за ответы!
Спустя 22 минуты, 47 секунд (16.09.2008 - 23:57) kirik написал(а):
экранировать пробелы надо, или заключать путь в кавычки
Код
system("C:\Program\ Files\Minuteman\ Software\GPSS\ World\ Student\ Version\GPSS\ World\ Student.exe",$rval);
OR
system('"C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe"',$rval);
OR
system('"C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe"',$rval);
Спустя 39 минут, 15 секунд (17.09.2008 - 00:36) kgenius написал(а):
Цитата(kirik @ 17.9.2008, 0:57) [snapback]48530[/snapback]
экранировать пробелы надо, или заключать путь в кавычки
Код
system("C:\Program\ Files\Minuteman\ Software\GPSS\ World\ Student\ Version\GPSS\ World\ Student.exe",$rval);
OR
system('"C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe"',$rval);
OR
system('"C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe"',$rval);
Премного благодарен! 2й способ заработал!
Спустя 15 дней, 22 часа, 32 минуты, 40 секунд (2.10.2008 - 23:08) kgenius написал(а):
Еще тут вопрос возник. Мне нужно запустить exe-шник с параметрами.
Вот так вот запускается:
system('"C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe" C:\TMP\C11.gps',$rval);
Но мне грубо говоря нужен еще 3й параметр
"Batch Mode
There is a background Batch Mode of operation that is useful when a large amount of processing is needed which does not require interactions on your part. Let's assume that the GPSS World Module Directory is either the DOS current directory or is listed in the PATH variable. From a DOS Command Line type
GPSSW FileSpec BATCH
where FileSpec is the file name of a Model Object or a Simulation Object. If the Objects are located in directories other than the GPSS World Module Directory, you should give a fully qualified pathname.
In Batch Mode GPSS World opens the object, and attempts to continue processing in a minimized window. If the Object is a Model, GPSS World automatically issues a Create Simulation menu command to translate it. If the Object is a Simulation, GPSS World passes a CONTINUE Command to it. You should insert an EXIT 1 Command or an Exit(1) invocation to close the session and save all the files.
You should not use Batch Mode until your Model has been well tested. Any Syntax Errors or Error Stops will cause the Session to be stopped. You will then have to deal with them by opening the window and interacting with the Session.
"
Вот параметр BATCH в конце никак не хочет работать... :-(
Вот так вот:
system('"C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe" C:\TMP\C11.gps BATCH',$rval);
ищется файл C:\TMP\C11.gps BATCH как единое целое...
Вот так вот запускается:
system('"C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe" C:\TMP\C11.gps',$rval);
Но мне грубо говоря нужен еще 3й параметр
"Batch Mode
There is a background Batch Mode of operation that is useful when a large amount of processing is needed which does not require interactions on your part. Let's assume that the GPSS World Module Directory is either the DOS current directory or is listed in the PATH variable. From a DOS Command Line type
GPSSW FileSpec BATCH
where FileSpec is the file name of a Model Object or a Simulation Object. If the Objects are located in directories other than the GPSS World Module Directory, you should give a fully qualified pathname.
In Batch Mode GPSS World opens the object, and attempts to continue processing in a minimized window. If the Object is a Model, GPSS World automatically issues a Create Simulation menu command to translate it. If the Object is a Simulation, GPSS World passes a CONTINUE Command to it. You should insert an EXIT 1 Command or an Exit(1) invocation to close the session and save all the files.
You should not use Batch Mode until your Model has been well tested. Any Syntax Errors or Error Stops will cause the Session to be stopped. You will then have to deal with them by opening the window and interacting with the Session.
"
Вот параметр BATCH в конце никак не хочет работать... :-(
Вот так вот:
system('"C:\Program Files\Minuteman Software\GPSS World Student Version\GPSS World Student.exe" C:\TMP\C11.gps BATCH',$rval);
ищется файл C:\TMP\C11.gps BATCH как единое целое...
Спустя 1 год, 3 месяца, 28 дней, 2 часа, 42 минуты, 15 секунд (31.01.2010 - 02:51) Гость_Doctor написал(а):
А в версиях выше 5,2 BATCH не поддерживается....= (((((