Jump to content
Sign in to follow this  
Gif

dir icon

Recommended Posts

Gif

is there any way to set the icon of a directory (folder), that you create?

Share this post


Link to post
Share on other sites
evilertoaster

programtically, you make a file called desktop.ini inside the folder in question. Inside the .ini will be somthing like-

[.ShellClassInfo]
IconFile=%SystemRoot%\system32\SHELL32.dll
IconIndex=10

Pretty strightforwad?

Edited by evilertoaster

Share this post


Link to post
Share on other sites
Gif

programtically, you make a file called desktop.ini inside the folder in question. Inside the .ini will be somthing like-

[.ShellClassInfo]
IconFile=%SystemRoot%\system32\SHELL32.dll
IconIndex=10

Pretty strightforwad?

any better way?

without INIs?

Share this post


Link to post
Share on other sites
evilertoaster

It's not like there's a 'way'....windows gets the folder icon information from here and that's all there is to it...when you change it via properties>customize>change icon that's all it does.

edit: this is on an xp machine, i dk about other versions of windows

Edited by evilertoaster

Share this post


Link to post
Share on other sites
Gif

It's not like there's a 'way'....windows gets the folder icon information from here and that's all there is to it...when you change it via properties>customize>change icon that's all it does.

edit: this is on an xp machine, i dk about other versions of windows

ok but must desktop.ini necesary be included in the directory?, when i create a directory from

properties>customize>change icon as you said i dont see it...

Share this post


Link to post
Share on other sites
dufran3

"show hidden files"

Share this post


Link to post
Share on other sites
Gif

"show hidden files"

pfffffff, try it yourself and see again that there is not desktop.ini....

Share this post


Link to post
Share on other sites
herewasplato

pfffffff, try it yourself and see again that there is not desktop.ini....

I see a desktop.ini file created whenever I use:

properties > customize > change icon

This is the way the Windows OS has set custom icons since Windows 3.0.

Find out what OS setting is preventing you from seeing the file or see how your OS is setup to somehow not make the desktop.ini file.

Post back with what you find.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
tAKTelapis

Try it this way

Create a folder called "test" on drive C:, and change its icon.

then Start> run

C:\TEST\desktop.ini

It will open, and that IS how windows does it.

And it is set as a proected operating system file (tools > folder options > hide protected operating system files)

Edited by tAKTelapis

Share this post


Link to post
Share on other sites
Gif

I see a desktop.ini file created whenever I use:

properties > customize > change icon

This is the way the Windows OS has set custom icons since Windows 3.0.

Find out what OS setting is preventing you from seeing the file or see how your OS is setup to somehow not make the desktop.ini file.

Post back with what you find.

is it the hide protected operating system files setting?

i made a search and found many desktop.ini and ok i created a directory and used iniwrite to create the code that

evilertoaster said in the same dir, but yet the icon is the same

exacly this:

[.ShellClassInfo]
IconFile=%SystemRoot%\system32\shell32.dll
IconIndex=10

what im i doing wrong?

Share this post


Link to post
Share on other sites
herewasplato

is it the hide protected operating system files setting?...

I'm not sure, I have my OS show all file - including system files.

...what im i doing wrong?...

try

[.ShellClassInfo]

IconFile=%SystemRoot%\system32\SHELL32.dll

IconIndex=27

and then add the "s" attrib per this site:

http://msdn2.microsoft.com/en-us/library/aa969337.aspx

Then close all file explorer windows and reopen one.

(refresh view did not always change the icon for me).


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
AdmiralAlkex

You probably already know this but just in case.....

A tip: Go to your AutoIt directory and then \Examples\GUI\Advanced\ and run enumicons.au3 then you can in a quick and easy way see all icons embedded in shell32.dll or any other file!!

Share this post


Link to post
Share on other sites
herewasplato

You might need the "h" attribute also.

While I was messing around with this, I managed to get my system into a state such that it would chage the icon - even with a system restart - until I added the "h" and "s" attributes... that is Windows for ya.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Gif

i still cant get it out, i used the attribute +s and i made this

[.ShellClassInfo]
ConfirmFileOp=0
NoSharing=1
IconFile=%SystemRoot%\system32\shell32.dll
IconIndex=10
InfoTip=folder created

can you give me some autoit code to do it? im very confused

Share this post


Link to post
Share on other sites
herewasplato

this worked for me:

MsgBox(0, "", IniWriteSection("c:\temp\desktop.ini", ".ShellClassInfo", "IconFile=%SystemRoot%\system32\SHELL32.dll" & @LF & "IconIndex=27"))
Run(@ComSpec & " /c " & 'attrib c:\temp\desktop.ini +s')
The msgbox should have a "1" in it if the IniWriteSection was a success.

Edit: but just like before - you play around with this enough and you can get into a state that the icon will not change - unless done manually.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Gif

this worked for me:

c2--><!--TXNnQm94KDAsICZxdW90OyZxdW90OywgSW5pV3JpdGVTZWN0aW9uKCZxdW90O2M6JiMwOTI7dGVtcCYjMDkyO2Rlc2t0b3AuaW5p
JnF1b3Q7LCAmcXVvdDsuU2hlbGxDbGFzc0luZm8mcXVvdDssICZxdW90O0ljb25GaWxlPSVTeXN0ZW1Sb290JSYjMDkyO3N5c3Rl
bTMyJiMwOTI7U0hFTEwzMi5kbGwmcXVvdDsgJmFtcDsgQExGICZhbXA7ICZxdW90O0ljb25JbmRleD0yNyZxdW90OykpClJ1bihA
Q29tU3BlYyAmYW1wOyAmcXVvdDsgL2MgJnF1b3Q7ICZhbXA7ICYjMzk7YXR0cmliIGM6JiMwOTI7dGVtcCYjMDkyO2Rlc2t0b3Au
aW5pICtzJiMzOTsp--><!--eg
The msgbox should have a "1" in it if the IniWriteSection was a success.
ok managed it! should have used filesetAttrib()

Share this post


Link to post
Share on other sites
herewasplato

ok managed it! should have used filesetAttrib()

That is funny.

One new AutoIt command per script :-)

As far as I know, I've never used any of the INI functions before this thread and now you want me to use FileSetAttrib too :-)

Thanks for the suggestion...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Gif

That is funny.

One new AutoIt command per script :-)

As far as I know, I've never used any of the INI functions before this thread and now you want me to use FileSetAttrib too :-)

Thanks for the suggestion...

im going to place the script on the exaple scripts forum, im trying to make folder accept icons whist having a tip...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×