Hi Dw

I have created a program to lock files and by default when a file is locked the file changes from being a folder to a lock. So what I want to do is to change the lock to my own image, just like how VLC do, it changes all the MP3 files to VLC icon if VLC is installed as a default media player so I want to do the similar thing too.

Thank you.

MSDN knows the answer. Read this.

@ddanbe, no, I didn't mean that. What I meant was that mmmmm let's make Visual Studio an example. The extension (.sln) is not recognized within Windows to which application can open it if you haven't installed Visual Studio on your computer, but once you have installed it, then the (.sln) will change to Visual Studio. (Not sure if you understand), another example is (.docx) which was introduced in Microsoft Word 2010 I think because before that it was (.doc) so the (.docx) maybe recognized by MS Word 2003 but won't be supported or opened till you install MS-Word 2010 or higher so with this extension file in your computer but not having MS-Word installed its will be of unknown.

One more last example is (.pdf) if you have this file but don't have Adobe Reader installed you won't be able to open this file. So coming back to my question, how to make my file extension have my own icon, like (.pdf) will have the Adobe Reader icon, (.txt) will have text icon, (.doc) will have Microsoft Word icon, (.xls) will have Microsoft Excel icon if Microsoft is installed?

Hope that's clear now.

Hello Mr.M,

I don't know if I got your idea...

In your example about music (Windows Media Player and VLC)

As default you have Windows Media Player as your Music Player

At the same time you installed VLC for new environment or stuff.

You want to play all your Music using VLC Player and automatic to use VLC.

Right click the one music, choose "Open With.." under that is "Choose default program.."

there you can see all the available music player.

If I got your point maybe you should include what program did you use.

Then maybe I can look a solution or someone can.

PS: I don't know if there is a Extension in a Folder. Folder can change the Icon in its Properties but I don't know if you can apply it to all.

Hello Sir Mr.M,

I don't know if this will help you..

I think your image must be .ico file.

This one is running a batch file:

Icon := "C:\SOFTWARE\_icons\red_folder.ico"

F1::
  loop 27 { ;A-Z (26) + (0-9) = 27
    SendInput, {AppsKey}
  Sleep 100
  SendInput,r  ;opens pRoperties window at General tab
    WinWaitActive, Properties
    SendInput, ^{Tab} ;Sharing tab
  Sleep 100
    SendInput, ^{Tab} ;Security tab
  Sleep 100
    SendInput, ^{Tab} ;Previous versions tab
  Sleep 100
    SendInput, ^{Tab} ;Customize tab
  Sleep 100
    SendInput, !i ;Change icon
  Sleep 100
    WinWaitActive, Change Icon
    SendInput, %Icon%
  Sleep 500
  SendInput, {Enter 3}
  Sleep 1000
  SendInput, {down} ;to next folder
  Sleep 200
  }
return

Source: https://autohotkey.com/board/topic/77788-batch-change-file-or-folder-icons/

I think it was set to press "F1" to change the Icon.

Maybe someone can help you in batch if this solution may solve your problem.

Thanks, the question has already been answered as to @Minimalist. I'm using a Phone at the moment and the option to mark thread solved is not visible.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.