From: Wolfgang.Ehrhardt.PLEASE.REMOVE@munich.netsurf.de   
      
   On Mon, 15 May 2006 15:52:28 GMT, Jim Bishop    
   wrote:   
      
   >I'm getting the following error:   
   >   
   >Borland Pascal Version 7.0 Copyright (c) 1983,92 Borland International   
   >Invalid switch - /X   
   >   
   >when I run the following short program compiled in Real Mode with no   
   >conditionals defined. From a command prompt the "DIR /X >TEST.TXT"   
   >works fine. Any pointers would be appreciated. I'm trying to map long   
   >directory/file names to short directory/file names.   
   >   
   >As a side note, when I comment out the SetMemTop lines in FreePascal, it   
   >runs fine; so I don't think it's the command itself.   
   >   
   >Jim   
   >   
   >   
   >   
   >   
   >PROGRAM test;   
   >USES   
   > DOS, MEMORY;   
   >{===============================================}   
   >PROCEDURE DO_COMMAND(S : STRING);   
   >BEGIN   
   >{$IFNDEF DPMI}   
   > SetMemTop(HeapPtr);   
   >{$ENDIF}   
   > SwapVectors;   
   > Exec(Getenv('comspec'), '/c ' + S);   
   > SwapVectors;   
   >{$IFNDEF DPMI}   
   > SetMemTop(HeapEnd);   
   >{$ENDIF}   
   >END; { DO_COMMAND }   
   >{================================================}   
   >BEGIN {test}   
   > do_command('DIR /X >TEMP.TXT');   
   >END. {test}   
      
   Which Operation System? I Guess Win2000 or XP, because under pure DOS   
   or Win98 /X is no valid option. What is the value of   
   Getenv('comspec')?   
      
   It maybe that command.com does not support /X but cmd.exe does, but   
   you cannot start cmd.exe from a 16 bit program (you CAN start it from   
   a 32 bit Freepascal console application). If this is the case you can   
   try the START command if you OS supports it.   
      
   Hope that helps   
   Wolfgang   
      
   --   
   In order to e-mail me a reply to this message, you will have   
   to remove PLEASE.REMOVE from the address shown in the header   
   or get it from http://home.netsurf.de/wolfgang.ehrhardt   
   (Free AES, CRC, Hash, and HMAC source for Pascal/Delphi)   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|