title: Delphi. ShellExecute command performs properly on Win 7 but not Win 8
body: <p>I am programming using Delphi 2010 on a 32-bit Windows 7 PC.</p>
  
  <p>The following code works when run on my PC as admin.</p>
  
  <pre><code>unit Unit1;
  
  interface
  
  uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, ShellApi;
  
  type
    TForm1 = class(TForm)
      procedure FormCreate(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;
  
  var
    Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  procedure TForm1.FormCreate(Sender: TObject);
  begin
    ShellExecute(0,'open','command','/c ipconfig /all &gt; testipco.txt','',0);
    showmessage('Test IP Config file should be written');
  end;
  
  end.
  </code></pre>
  
  <p>The file TESTIPCO.TXT is output and contains the same results as typing ipconfig /all into a Command Prompt window.</p>
  
  <p>When I compile the file and run it on a 64-bit Windows 8.1 PC as admin, the program appears to run OK, displaying the message (with no errors) but the file TESTIPCO.TXT is not produced.</p>
  
  <p>Even running the exe on a Windows 8 machine with compatibility set to run as Windows 7 doesn't work.</p>
  
  <p>I just cannot work out why this is the case. I'm hoping that one of you bright people may be able to steer me in the right direction.       </p>