• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2286
  • Last Modified:

Change .bat File Icon Using VB5

How do you change a .bat file icon using VB?
0
Root
Asked:
Root
  • 2
  • 2
1 Solution
 
Olli083097Commented:
You can change the value in the register!
The value is located under HKEY_CLASSES_ROOT\batfile\DefaultIcon
the default value is: C:\WINDOWS\SYSTEM\shell32.dll,-153
But you can change this to the icon you want!
0
 
RootAuthor Commented:
I don't want to change the icon for all .bat files but merely certain ones.
0
 
Olli083097Commented:
Is it for .bat files with a certain name, like start.bat?
0
 
RootAuthor Commented:
No, they will have different names.  In addtiion, they will each need to have a different icon.
0
 
MirkwoodCommented:
Oke, it can be done but it is a littlebit tricky and it involves the registry.

With @=  I mean that your should enter this as value for the folder.

HKEY_CLASSES_ROOT\CLSID\{6465F040-4381-1090-9F32-00AA002F954E}\DefaultIcon
~@=location of icon file or dll name like shell32.dll,153 or c:\temp\icon1.ico
HKEY_CLASSES_ROOT\CLSID\{6465F040-4381-1090-9F32-00AA002F954E}\Shell\Open\Command
@="%1" %*

Rename your batfile to <name>.bat.{6465F040-4381-1090-9F32-00AA002F954E}

Note that the {..} will disappear and the icon will change.
--
Another solution is to make a copy of the registry information under batfile to batfile1. Now change the defaulticon value of batfile1.
Enter a new key under classes root called .bat1 with value batfile1.
Rename your bat file to <name>.bat1
--


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now