title: How to create shortcut with icon on desktop using Batch file?
body: <p>I wanted to create shortcut on desktop with icon using batch file like this:</p>
  
  <pre><code>set SCRIPT="%TEMP%\theiboosts1.vbs"
  
  echo Set oWS = WScript.CreateObject("WScript.Shell") &gt;&gt; %SCRIPT%
  echo sLinkFile = "%USERPROFILE%\Desktop\Internetovy Booster.lnk" &gt;&gt; %SCRIPT%
  echo Set oLink = oWS.CreateShortcut(sLinkFile) &gt;&gt; %SCRIPT%
  echo oLink.TargetPath = "c:\Booster\booster.bat" &gt;&gt; %SCRIPT%
  echo oLink.Save &gt;&gt; %SCRIPT%
  
  "%windir%\system32\timeout.exe" /t 5
  
  start wscript.exe "%SCRIPT%"
  
  "%windir%\system32\timeout.exe" /t 10
  echo Const DESKTOP = &amp;H10&amp;&gt;&gt;"%TEMP%\testboost.vbs"
  "%windir%\system32\timeout.exe" /t 5
  echo Set objShell = CreateObject("Shell.Application") &gt;&gt;"%TEMP%\testboost.vbs"
  "%windir%\system32\timeout.exe" /t 5
  echo Set objFolder = objShell.NameSpace(DESKTOP) &gt;&gt;"%TEMP%\testboost.vbs"
  "%windir%\system32\timeout.exe" /t 5
  echo Set objFolderItem = objFolder.ParseName("Internetovy Booster.lnk") &gt;&gt;"%TEMP%\testboost.vbs"
  "%windir%\system32\timeout.exe" /t 5
  echo Set objShortcut = objFolderItem.GetLink &gt;&gt;"%TEMP%\testboost.vbs"
  "%windir%\system32\timeout.exe" /t 5
  echo objShortcut.SetIconLocation "C:\Windows\System32\SHELL32.dll",-16752 &gt;&gt;"%TEMP%\testboost.vbs"
  "%windir%\system32\timeout.exe" /t 5
  echo objShortcut.Save &gt;&gt;"%TEMP%\testboost.vbs"
  
  "%windir%\system32\timeout.exe" /t 5
  
  start wscript.exe "%TEMP%\testboost.vbs"
  
  "%windir%\system32\timeout.exe" /t 5
  </code></pre>
  
  <p>But it wrote an Error:</p>
  
  <p><a href="http://i.stack.imgur.com/UyPHd.png" rel="nofollow">Syntex of the command is incorrect</a></p>
  
  <p>but there is no command between</p>
  
  <pre><code>"%windir%\system32\timeout.exe" /t 10
  </code></pre>
  
  <p>and</p>
  
  <pre><code>echo Const DESKTOP = &amp;H10&amp;&gt;&gt;"%TEMP%\testboost.vbs"
  </code></pre>
  
  <p>When i create .vbs file it is working correctly</p>
  
  <pre><code>Const DESKTOP = &amp;H10&amp;
  
  Set objShell = CreateObject("Shell.Application")
  Set objFolder = objShell.NameSpace(DESKTOP)
  
  Set objFolderItem = objFolder.ParseName("Internetovy Booster.lnk")
  Set objShortcut = objFolderItem.GetLink
  
  objShortcut.SetIconLocation "C:\Windows\System32\SHELL32.dll",-16752
  objShortcut.Save
  </code></pre>
  
  <p>Can someone help me?</p>