[.ShellClassInfo] ConfirmFileOp=0 InfoTip=我自己的文件夹 IconIndex=0 IconFile=MyFolder.ico |
attrib +s i:\MyFolder |
Option Explicit Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long Private Declare Function PathMakeSystemFolder Lib "shlwapi.dll" Alias "PathMakeSystemFolderA" (ByVal pszPath As String) As Long Private Sub Form_Load() @#以下几步用于创建Desktop.ini文件 @#不存在ini文件时,会自己创建ini WritePrivateProfileString ".ShellClassInfo", "ConfirmFileOp", "0", App.Path & "\desktop.ini" WritePrivateProfileString ".ShellClassInfo", "InfoTip", "我的文件夹因此而改变", App.Path & "\desktop.ini" WritePrivateProfileString ".ShellClassInfo", "IconIndex", "0", App.Path & "\desktop.ini" WritePrivateProfileString ".ShellClassInfo", "IconFile", "MyFolder.ico", App.Path & "\desktop.ini" @#让文件夹成为系统文件夹 PathMakeSystemFolder App.Path End Sub |
WritePrivateProfileString ".ShellClassInfo", "IconFile", "MyFolder.ico", App.Path & "\desktop.ini" |
WritePrivateProfileString ".ShellClassInfo", "IconFile", App.EXEName & ".exe", App.Path & "\desktop.ini" |