3 Replies - 1659 Views - Last Post: 03 April 2012 - 02:36 PM Rate Topic: -----

#1 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 1953
  • View blog
  • Posts: 4,053
  • Joined: 11-December 07

Wrong icon when launching from a Windows batch file

Posted 06 February 2012 - 05:05 AM

I've written a short Windows batch file to start up all the tools I'm using for writing my thesis:

Texmaker.
Latest PDF of my thesis in Evince.
A Windows Explorer window with the main thesis directory.
A Git BASH window.

It works perfectly apart from one small but important detail. The application icon for the Git Bash window is the normal cmd icon, not the Git icon.

@echo off

rem Opens Texmaker, current directory, Git BASH and latest PDF of thesis.

set texPath="C:\Program Files (x86)\Texmaker\"
set docPath=%cd%\LaTeX\thesis.tex
start /D %texPath% texmaker.exe %docPath% -master

start %SystemRoot%\explorer.exe .

start /D .\LaTeX\ thesis.pdf

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i



The way the code is just now, I can understand why that is the case but I have tried a few things:

Create a shortcut to git bash with a custom icon: Works when I double click the icon but not launch from the batch file.

Give the batch file a shortcut with an icon: This has no effect at all.

This is really a small annoyance, but if I have even a couple more windows open then it's difficult to spot the Git window in the taskbar. Any help would be much appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Wrong icon when launching from a Windows batch file

#2 Gorian  Icon User is offline

  • ninja DIC
  • member icon

Reputation: 120
  • View blog
  • Posts: 1,681
  • Joined: 28-June 08

Re: Wrong icon when launching from a Windows batch file

Posted 06 February 2012 - 03:40 PM

Well, a couple things.

  • Custom icons is a thing that windows shortcuts do, it can't be done as a function of a batch file as far as I am a aware
  • is the shortcut opening C:\Program Files (x86)\Git\bin\sh.exe or another program first (I.E. xterm or rxvt that then launches sh)?

Was This Post Helpful? 1
  • +
  • -

#3 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 1953
  • View blog
  • Posts: 4,053
  • Joined: 11-December 07

Re: Wrong icon when launching from a Windows batch file

Posted 09 February 2012 - 07:24 AM

It was opening sh.exe. You were right about the shortcut. If I opened a shortcut it would keep the custom icon. I'm sure I had tried that before but apparently not.

Thanks for your help!
Was This Post Helpful? 0
  • +
  • -

#4 Gorian  Icon User is offline

  • ninja DIC
  • member icon

Reputation: 120
  • View blog
  • Posts: 1,681
  • Joined: 28-June 08

Re: Wrong icon when launching from a Windows batch file

Posted 03 April 2012 - 02:36 PM

a bit late on this, but you are welcome. Glad I could help :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1