Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Свои иконки у папок 
Author Message
Batya



PostPosted: Mon Apr 24, 2006 13:58    Post subject: Reply with quote

LocKtaR-o-DarK дал идею:
Ставим курсор на файл с иконкой, нажимаем кнопку, и создается Desktop.ini.

Вот что получилось:
Code:
'============================
' Создание файла Desktop.ini

' Параметры вызова из TC:
' "%P" "%N"
'============================

Dim FSO, TargetDir, IconFile, FileName, oDir, Attr, oFile
Set FSO = CreateObject("Scripting.FileSystemObject")

TargetDir = WScript.Arguments(0)
IconFile  = WScript.Arguments(1)
FileName  = "Desktop.ini"

' Установим для папки атрибут "Только чтение"
Attr = 1
Set oDir  = FSO.GetFolder(TargetDir)
oDir.Attributes = oDir.Attributes or Attr

'Создадим Desktop.ini
If not FSO.FileExists(TargetDir & FileName) Then
  Set oFile  = FSO.CreateTextFile(TargetDir & FileName)
  oFile.WriteLine "[.ShellClassInfo]"
  oFile.WriteLine "IconFile=" & IconFile
  oFile.WriteLine "IconIndex=0"
  oFile.Close
  ' Установим для файла атрибуты "Скрытый", "Системный", "Архивный"
  Attr = 38
  Set oFile = FSO.GetFile(TargetDir & FileName)
  oFile.Attributes = oFile.Attributes or Attr
End If

Set FSO   = Nothing
Set oDir  = Nothing
Set oFile = Nothing
WScript.Quit


ЗЫ. Для тех, кто еще не в курсе Wink - это файл *.vbs. Вешать на кнопку или в меню "Запуск".
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group