Help with batch file

  • Thread starter Thread starter George
  • Start date Start date
G

George

Guest
I have about 40 different shortcuts in various folders that have

the same icon, let's call it icon A. I would like to change icon

A to a different icon, icon B. I know I can make the changes

individually, shortcut by shortcut, but am wondering if a batch

file might do the trick in one full sweep. If anyone can tell me

how to create such a batch file, in other words, the various lines

needed, I would be most grateful.



T.i.a.

George



P.S. Icon A is inside an exe file, Icon B is an ico file.
 
George wrote:

> I have about 40 different shortcuts in various folders that have

> the same icon, let's call it icon A. I would like to change icon

> A to a different icon, icon B. I know I can make the changes

> individually, shortcut by shortcut, but am wondering if a batch

> file might do the trick in one full sweep. If anyone can tell me

> how to create such a batch file, in other words, the various lines

> needed, I would be most grateful.

>

> T.i.a.

> George

>

> P.S. Icon A is inside an exe file, Icon B is an ico file.




Change one, copy to the other locations/replacing the existing file.



--

Shenan Stanley

MS-MVP

--

How To Ask Questions The Smart Way

http://www.catb.org/~esr/faqs/smart-questions.html
 
"George" wrote in

news:#vvLJZ6qKHA.3408@TK2MSFTNGP06.phx.gbl:



>

> I have about 40 different shortcuts in various folders that

> have the same icon, let's call it icon A. I would like to

> change icon A to a different icon, icon B. I know I can

> make the changes individually, shortcut by shortcut, but am

> wondering if a batch file might do the trick in one full

> sweep. If anyone can tell me how to create such a batch

> file, in other words, the various lines needed, I would be

> most grateful.

>

> T.i.a.

> George

>

> P.S. Icon A is inside an exe file, Icon B is an ico file.




You have to get a few programs and be prepared to spend some

time - but the results are well worth it.



First, you need an icon extractor. I use an oldie freebie but

goodie called Iconjack32 (from PC Magazine year 2000).



Then you need a program like Axialis Icons (which I use) or

Michelangelo (which is mentioned all the time) to make/edit and

then combine icons into a DLL or exe file.



You need to assemble all the icons you like from wherever, and

create a DLL file to be put in your system32 directory. I call

mine "__2010.DLL", so it appears /first/. Whenever you right-

click and get to "change icon" on any icon on the desktop (or in

start menu shortcuts or wherever) it will (usually) start with

the program exe file and then the program directory etc. Many

programs' icons are stupid or butt ugly. So you click down to

win\sys32 and see the icon DLL file. You click on that and you

choose the icon you want.



You have to do that for every icon and doing it once in the

start menu will NOT change the icon for other shortcuts, on the

desktop, etc.



If you have a great program with unbearable-to-look-at icons,

there are other tools, one is resource hacker, one is resource

tuner. There may be more. They will let you change icons (and

other things like dialog boxes text) without actually changing

the /program/.



There are sites devoted to icons which may have links for all

this stuff.



If you have further questions, ask me.



(There is no batch file way to do it, the only other way to do

it is to go inside the registry, FIND the key for each program's

icon, and put in what in my case might be value "default" the

data "__2010.DLL,73" which will give you the seventy FOURTH icon

from the DLL file. But an additional problem is not all programs

(that I've noticed anyway) store their main icon {let alone all

the other icons} in the registry. {For *those* you /need/

resource tuner.})







--

The lonely child plays with eternity, while a gang of children

plays with time.

Karel Capek
 
"George" said this in news item

news:#vvLJZ6qKHA.3408@TK2MSFTNGP06.phx.gbl...

> I have about 40 different shortcuts in various folders that have the same

> icon, let's call it icon A. I would like to change icon A to a different

> icon, icon B. I know I can make the changes individually, shortcut by

> shortcut, but am wondering if a batch file might do the trick in one full

> sweep. If anyone can tell me how to create such a batch file, in other

> words, the various lines needed, I would be most grateful.

>

> T.i.a.

> George

>

> P.S. Icon A is inside an exe file, Icon B is an ico file.




It's fairly easy to automate the creation of icons - the VB Script file

further down will do it. However, in your case this is probably not the

answer. Since your shortcuts reside in different folders and require

different icons, it is difficult to create an automatic process. By the time

you've finished creating, debuggin and testing it, you've probable used ten

times as much time as if you had done it manually.



'Create a shortcut with VB Script

sName = "d:\Test.lnk"

Set oFSO = CreateObject("Scripting.FileSystemObject")

Set oShell = CreateObject("WScript.Shell")

if oFSO.FileExists(sName) then oFSO.DeleteFile(sName)

Set oShortcut = oShell.CreateShortcut(sName)



With oShortcut

.TargetPath = "C:\Program Files (x86)\Microsoft

Office\OFFICE11\Excel.exe"

.arguments = ""

.Description = "Excel Launcher"

.IconLocation = "e:\Technical\Icons\progman15.ico"

.HotKey = "Alt+Shift+A"

.Save

End With
 
"George" wrote in

news:#vvLJZ6qKHA.3408@TK2MSFTNGP06.phx.gbl:



>

> I have about 40 different shortcuts in various folders that

> have the same icon, let's call it icon A. I would like to

> change icon A to a different icon, icon B. I know I can

> make the changes individually, shortcut by shortcut, but am

> wondering if a batch file might do the trick in one full

> sweep. If anyone can tell me how to create such a batch

> file, in other words, the various lines needed, I would be

> most grateful.

>

> T.i.a.

> George

>

> P.S. Icon A is inside an exe file, Icon B is an ico file.




The simpler way, and if you only have a few icons to deal with,

is this:



Search in the registry for the types of files using icon A. (I

will /assume) they are all the same kind of file, although it

does raise a variety of questions, like HOW did they all end up

the same. IME, most icons which are the same are basic system

icons and changing them might not be a good idea.)



Change the icon data for that file extension to "c:\windows\SOME

DIR OR JUST ROOT\iconB.ico" (or somewhere else, or even one of

the few icons in a small DLL file as described in my previous

post).



Still has to be done manually. Making even a small DLL file has

the advantage of keeping most of it in one place. Anytime you

reinstall the system or some (usually) MS program messes with

it, you MAY have to do it again.





--

The lonely child plays with eternity, while a gang of children

plays with time.

Karel Capek
 
Back
Top