- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to use SYSTEMQQ with quotes for the command and arguments and it doesn't seem to work. It's OK if either the command or the arguments are quoted, but not both.
result = systemqq ( ' "C:\Program Files (x86)\Notepad++\notepad++" "c:\temp\new file.txt" ' )
gives me the error:
'C:\Program' is not recognized as an internal or external command, operable program or batch file.
The following commands work as expected:
result = systemqq ( ' dir "c:\temp\new file.txt" ' )
result = systemqq ( ' "C:\Program Files (x86)\Notepad++\notepad++" c:\temp\new_file.txt ' )
How do I use this if both the command and the arguments have spaces?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Fortran, a pair of quote marks is taken as a single one:
so you should be able to get 2 quotes (if that's what you wanted) from 2 pairs of quotes (I suppose "" "")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try the following, which sidesteps the rules regarding quotes within quotes.
use ifport character*132 cmd integer iret write(cmd,10)'C:\Program Files (x86)\Notepad++\notepad++','C:\temp\new file.txt' 10 format('""',A,'" "',A,'""') iret=systemqq(cmd)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem was not with my formatting, it was with the command interpreter. Apparently I need quotes around my string with multiple sets of quotes.
..., string is processed by examining the first character to verify whether or not it is an opening quotation mark. If the first character is an opening quotation mark, it is stripped along with the closing quotation mark. Any text following the closing quotation marks is preserved.
This works
result = systemqq ( '""C:\Program Files (x86)\Notepad++\notepad++" "c:\temp\new file.txt""' )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The quotation is, if I am not mistaken, taken from the MSDN documentation for the XP command processor, CMD.
Seen by itself, it is a bit humorous, is it not? "If the first character is an opening quotation mark"? There are no separate characters for "opening" and "closing" quotation marks, so whether a quotation mark is "opening" or "closing" is determined by context; a first character in a string, if a quotation mark, must be an opening quotation mark.
There is a similar ambiguity about "the closing quotation mark". Is that the first non-escaped matching quote that is encountered by scanning forward, or are you supposed to do a reverse scan from the end of the string?

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