Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
Dodle
- Posts: 1
- Joined: 08 Feb 2009 14:51
#1
Post
by Dodle » 08 Feb 2009 14:57
Hello, I want to create a batch file that will change the icon of an associated file type. I have already figured out how to change file associations using ftype, but cannot find any information on changing the icons for a type.
Here's a rough example of the layout of what I think the batch file might look like:
Code: Select all
chgicon 7-Zip.7z %ProgramFiles%\7-Zip\7z.dll,0
Anyone think they can give me some help with this. Again, I haven't been able to find any info googling. Thanks in advance.
Edit: I'm new to batch. I know chgicon isn't a real command.
-
alan
- Posts: 1
- Joined: 02 Mar 2009 09:18
#2
Post
by alan » 02 Mar 2009 09:29
Hey Dodle,
There's a powerfull dos tool out there called associate.exe .
It has the abbilitie (between lots of other stuff) to play with the icon association.
Hope it helps.
Here are the different functions that can be used.
ASSOCIATE, Version 2.06
Associates a command with a file name extension.
ASSOCIATE [/L] {.ext|class}
ASSOCIATE [options] {.ext|class}[(filetype)] action=command parameters
ASSOCIATE [options] {.ext|class}[(filetype)] action:field=data
ASSOCIATE [options] {.ext|class}[(filetype)]:ORDER=action,action[,action[,...]]
ASSOCIATE [options] {.ext|class}[(filetype)]:ICON=iconfile,number
ASSOCIATE [options] .ext:NEWCMD=command parameters
ASSOCIATE [options] .ext:NEWFILE=filename
ASSOCIATE [options] .ext:NEWNULL
ASSOCIATE [options] .ext={.ext|class}
ASSOCIATE [options] /F cmdfile
/L Print lots of information on the registered file type.
ext File name extension.
class Class name.
filetype A description of the file type. This is only required if a new
file type needs to be created.
action The text that will appear in the context menu for this file type.
This text may include spaces. You may preceed hotkeys with '&'.
command The command that will be executed when the menu item is selected.
Pathnames which include spaces must be enclosed in quotes.
If a path is not specified, this application will seach for it.
parameters The command parameters. Use "%1" to represent the file name.
field One of the following DDE fields:
data DDEMSG = message
DDERUN = message if not running
DDEAPP = application
DDETOP = topic
iconfile The file which contains the icon.
Pathnames which include spaces must be enclosed in quotes.
If a path is not specified, this application will seach for it.
number The number of the icon in the file.
filename Name of a file in the "C:\WINDOWS\ShellNew" directory.
cmdfile Read the command line parameters from this file (except options).
Comment lines must begin with a semicolon character.
options:
/P Print registry changes, but don't actually make the changes.
/Q Quiet mode -- don't display informational messages.
/V Verbose mode.
Notation: [] = optional, {a|b} = either a or b, lowercase = variable.
Associating a command with an action will automatically delete any pre-existing
DDE commands for that action. Therefore, DDE associations must be done after
the corresponding command association.