- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
The following:
if(.not.CreateProcess(null,trim(fmis$exec)//'\FMISAutoUpdate.bat '//trim(StartupFile)//char(0), &
null,null,false,0,null,null,si,pi))then
works well when StartupFile is a space padded string. But occasionally I want to pass an argument to the batch file, in which caseStartupFile contains a path\filename. When this occurs the created process flashes the DOS window then immediately exits - it does not even "pause" on the first line of the command script. Both fmis$exec and StartupFile contain embedded spaces - I have tried every combination of double quotes I can think of but that makes no difference, and in any case, when StartupFile is space filled, fmis$exec is acceptable without quotes. What am I doing wrong?
With many thanks in advance,
Mike
The following:
if(.not.CreateProcess(null,trim(fmis$exec)//'\FMISAutoUpdate.bat '//trim(StartupFile)//char(0), &
null,null,false,0,null,null,si,pi))then
works well when StartupFile is a space padded string. But occasionally I want to pass an argument to the batch file, in which caseStartupFile contains a path\filename. When this occurs the created process flashes the DOS window then immediately exits - it does not even "pause" on the first line of the command script. Both fmis$exec and StartupFile contain embedded spaces - I have tried every combination of double quotes I can think of but that makes no difference, and in any case, when StartupFile is space filled, fmis$exec is acceptable without quotes. What am I doing wrong?
With many thanks in advance,
Mike
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - michaelgreen
Hi All,
The following:
if(.not.CreateProcess(null,trim(fmis$exec)//'FMISAutoUpdate.bat '//trim(StartupFile)//char(0), &
null,null,false,0,null,null,si,pi))then
works well when StartupFile is a space padded string. But occasionally I want to pass an argument to the batch file, in which caseStartupFile contains a pathfilename. When this occurs the created process flashes the DOS window then immediately exits - it does not even "pause" on the first line of the command script. Both fmis$exec and StartupFile contain embedded spaces - I have tried every combination of double quotes I can think of but that makes no difference, and in any case, when StartupFile is space filled, fmis$exec is acceptable without quotes. What am I doing wrong?
With many thanks in advance,
Mike
The following:
if(.not.CreateProcess(null,trim(fmis$exec)//'FMISAutoUpdate.bat '//trim(StartupFile)//char(0), &
null,null,false,0,null,null,si,pi))then
works well when StartupFile is a space padded string. But occasionally I want to pass an argument to the batch file, in which caseStartupFile contains a pathfilename. When this occurs the created process flashes the DOS window then immediately exits - it does not even "pause" on the first line of the command script. Both fmis$exec and StartupFile contain embedded spaces - I have tried every combination of double quotes I can think of but that makes no difference, and in any case, when StartupFile is space filled, fmis$exec is acceptable without quotes. What am I doing wrong?
With many thanks in advance,
Mike
Try the following:
char*1 quote
quote='"'
trim(fmis$exec)//"FMISAutoUpdate.bat "//quote//trim(StartupFile)//quote//char(0)
if fmis$exec works with blanks, you may just be benifiting from the system trying various combinations, one of which works. For example, to quote from the Help for Creatprocess
" For example, consider the string "c:program filessub dirprogram name". This string can be interpreted in a number of ways. The system tries the possibilities in the following order:
c:program.exe filessub dirprogram name
c:program filessub.exe dirprogram name
c:program filessub dirprogram.exe name
c:program filessub dirprogram name.exe
"

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page