Can't get good output from SYSTEM

Kenneth Brody kenbrody at bestweb.net
Thu Jan 24 14:48:41 PST 2008


Quoting Boaz Bezborodko (Thu, 24 Jan 2008 17:37:09 -0500):

[...]
> Then: flname="f:/fpro/temp/"&ab{PrintFileName{aa ◄
[...]
> Then: ad=flname{".txt" ◄
[...]
> Then: SYSTEM "TYPE "&ad&" >> "&af ◄
> 13 ------- - - - - - - - - - - - - - - - -
>
> The error occurs at line 12. I have tried any number of different ways
> and I can't get it to work right. The error I'm getting is
> "The syntax of the command is incorrect."
>
> But if I type the results directly into the Command line it works fine.
>
> What am I doing wrong.

Are you _sure_ you are typing in the exact same command at the command
prompt, including the use of forward slashes?

==========
C:\temp>type c:/config.sys
The syntax of the command is incorrect.

C:\temp>type c:\config.sys
device=c:\windows\system32\ansi.sys

C:\temp>
==========

As I stated in my example, command.com/cmd.exe internal commands to not
parse filenames with forward slashes.  My example coincidentally used the
"type" command.

For the above SYSTEM command to work, you _must_ use backslashes.  That's
simply a limitation of the TYPE command.  (Note, however, just to add to
the confusion, the ">" redirection does take forward slashes.)

-- 
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list