title: Changing node webkit app icon on windows from cli
body: <p>I'm currently trying to build a .bat script to autobuild my node-webkit application, and the only missing thing is changing the generated .exe icon. </p>
  
  <p>I've been digging the interwebs for a while whitout finding any working solution. </p>
  
  <p>So far I've tried : </p>
  
  <ul>
  <li><a href="http://www.angusj.com/resourcehacker/" rel="nofollow noreferrer">Resource Hacker</a> : I managed to change the icon using the application, but could not make it work with a script. Here is a screenshot of resource hacker with my exe <img src="https://i.stack.imgur.com/xKwli.png" alt="Resource Hacker with my exe opened">
  I tried the following commands :
  
  <ul>
  <li><code>ResHacker -modify App.exe, AppTest.exe, MyIcon.ico, Icon, 1</code></li>
  <li><code>ResHacker -modify App.exe, AppTest.exe, MyIcon.ico, Icon, 1, 1033</code></li>
  <li><code>ResHacker -addoverwrite App.exe, AppTest.exe, MyIcon.ico, "Icon Group", IDR_MAINFRAME, 1033</code></li>
  <li><code>ResHacker -addoverwrite App.exe, AppTest.exe, MyIcon.ico, "Icon Group", IDR_MAINFRAME</code></li>
  </ul></li>
  </ul>
  
  <p>Unfortunately, none of these created the AppTest.exe file neither did they print and error message.</p>
  
  <ul>
  <li><p><a href="http://winrun4j.sourceforge.net/" rel="nofollow noreferrer">RCEDIT.exe</a> which is part of the WinRun4JS application, their home page shows an example of using RCEDIT to change the icon : <code>RCEDIT.exe /I [YourApp].exe [YourApp].ico</code>, this is indeed working iconwise, but it breaks the node-webkit executable and leaves me with an application running the default nodejs page. ( As a reminder, node-webkit exe are built <a href="https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps#windows-1" rel="nofollow noreferrer">this way</a></p></li>
  <li><p>Various other applications worked fine but none of them seemed to propose a command line interface. </p></li>
  </ul>
  
  <p>I feel like I'm quite close to the solution with Resource Hacker and I might have missed something obious while fiddling with it but right now I can't thing of anything else to try. </p>
  
  <p>Thank you for reading and have a nice day !   </p>