M
MikeB77
Hello
I'm having trouble reliably setting the icon of a new folder that I generate
with filesystemobject. Once I've made a new folder (named 'fldName'), I want
to set its icon. I can do this by adding a desktop.ini file within the
folder:
Dim fs
Set fs = CreateObject("scripting.filesystemobject")
Set getMyRecentPathsFld = fs.createfolder(fldName) 'returns the folder from
my function
FName = fldName & "\Desktop.ini"
System.PrivateProfileString(FName, ".ShellClassInfo", "IconFile") =
"%SystemRoot%\system32\SHELL32.dll"
System.PrivateProfileString(FName, ".ShellClassInfo", "IconIndex") = 155
This generates a desktop.ini as desired. BUT the folder's icon doesn't
change with this code until I first change it manually (via properties...),
after which it works fine. If the folder icon has not been changed manually
the new desktop.ini file looks fine but the icon does not change. I don't
understand why.
Am I missing something here, like some way of telling the folder to look for
a desktop.ini? Or is there a better way?
Thanks in advance
Mike
I'm having trouble reliably setting the icon of a new folder that I generate
with filesystemobject. Once I've made a new folder (named 'fldName'), I want
to set its icon. I can do this by adding a desktop.ini file within the
folder:
Dim fs
Set fs = CreateObject("scripting.filesystemobject")
Set getMyRecentPathsFld = fs.createfolder(fldName) 'returns the folder from
my function
FName = fldName & "\Desktop.ini"
System.PrivateProfileString(FName, ".ShellClassInfo", "IconFile") =
"%SystemRoot%\system32\SHELL32.dll"
System.PrivateProfileString(FName, ".ShellClassInfo", "IconIndex") = 155
This generates a desktop.ini as desired. BUT the folder's icon doesn't
change with this code until I first change it manually (via properties...),
after which it works fine. If the folder icon has not been changed manually
the new desktop.ini file looks fine but the icon does not change. I don't
understand why.
Am I missing something here, like some way of telling the folder to look for
a desktop.ini? Or is there a better way?
Thanks in advance
Mike