title: GetFileAttributes Function
body: <pre><code>#include "stdafx.h"
  #include &lt;Windows.h&gt;
  #include &lt;conio.h&gt;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      DWORD d = GetFileAttributes(argv[0]);
      _TCHAR* temp;
      printf("%d\n", d);
      switch(d)
      {
          case 2048: temp = L"Compressed"; break;
          case 32: temp = L"Archive"; break;
          case 16: temp = L"Directory"; break;
          case 16384: temp = L"Encrypted"; break;
          case 2: temp = L"Hidden"; break;
          case 128: temp = L"Normal"; break;
          case 1: temp = L"Readonly"; break;
          case 4: temp = L"System"; break;
          case 256: temp = L"Temporary"; break;
          default: temp = L"Error or unsupported attribute"; break;
      }
      _tprintf(temp);
      getch();
  
      return 0;
  }
  </code></pre>
  
  <p>what's wrong with this code? I always get 32 in d, even when I launch it with no attributes?
  I'm using visual studio 2010.
  Thank you!</p>