title: clear icon cache in win 7 programmatically - execute ie4uinit.exe-ClearIconCache using C# or Visual Basic
body: <p>We changed the logo-icon of our WPF application, and then the icon of the main executable. On my PC with Win 7, there is a problem with the refresh of the icon cache: the desktop shortcut to the main executable, and the preview of the icon of the executable, in Windows Explorer still shows the old icon.
  Even restarting the system the problem persists.</p>
  
  <p>I found that running this command solves the problem:</p>
  
  <p>ie4uinit.exe-ClearIconCache</p>
  
  <p>My problem is that I can't run it from code. I made two attempts.</p>
  
  <hr>
  
  <p>First:</p>
  
  <pre><code>Dim si As New ProcessStartInfo()
  si.CreateNoWindow = False
  si.UseShellExecute = False
  si.FileName = "ie4uinit.exe"
  si.WindowStyle = ProcessWindowStyle.Hidden
  si.Arguments = "-ClearIconCache"
  Dim p As Process = Process.Start(si)
  </code></pre>
  
  <p>error: "Could not find the specified file" - I tried to input the full path but it still doesn't find the file</p>
  
  <hr>
  
  <p>Second:</p>
  
  <p>I put the command in a batch file</p>
  
  <pre><code>Dim si As New ProcessStartInfo("C:\test.bat")
  si.UseShellExecute = False
  si.RedirectStandardError = True
  si.RedirectStandardInput = True
  si.RedirectStandardOutput = True
  si.CreateNoWindow = True
  si.ErrorDialog = False
  si.WindowStyle = ProcessWindowStyle.Hidden
  Dim p As Process = Process.Start(si)
  </code></pre>
  
  <p>This time I get no errors, but not even the desired effect. If I double-click on the batch file instead, everything is working fine.</p>
  
  <p>I'd like to adjust one of these procedure otherwise finding a new one to clear the windows icon cache. C# or Visual Basic is not important...
  Pileggi</p>