ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Comments Column Notes

(1/1)

mykemo:
I have looked everywhere for a small utility app that lets users add comments to a folder so the comments appear in the "Comments" column of Windows Explorer.  I have a lot of folders and sub-folders.  Right now I am making the name of each folder really long to accurately describe the contents of the folder.  If the notes would appear in the "Comments" column, the folder names could be made much shorter and easier.  I can make the comments appear for files, but how about for the folder.  Please create a small utility app for adding, deleting and editing folder commets so they appear in the Windows Explorer screen.

lifeweaver:
This script with add/modify comments on folders via the Desktop.ini, to do this it makes the folder a system folder.
I couldn't figure out how to get explorer to reliably refresh but know that eventually the comments you choose will appear.

Use the script by installing AutoHotkey, double clicking on the script, and pressing alt + z.



--- ---;
; ==========================================================================================================
; Author               : LifeWeaver <[email protected]>
; Script Name        : SetFolderComments
; Script Version     :
; Homepage          :
;
; Creation Date      : 08/07/2015
; Modification Date :
;
; Description       : Lets you set comments on a folder via Desktop.ini
; ===================
;
; ----------------------------------------------------------------------------------------------------------

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance force

ActiveExplorerWindow()
{
  for window in ComObjCreate("Shell.Application").Windows
    if window.HWND = WinExist("A")
      return window
}

ExplorerItemsSelected(window)
{
  return window.Document.SelectedItems().count
}

SetFolderComments(folderPath, comments)
{
  desktopIniPath := folderPath . "\desktop.ini"
  ifExist %desktopIniPath%
  {
    ; desktop.ini file exists edit the InfoTip
    FileRead, desktopIniContents, %desktopIniPath%
  }
  else
  {
    ; set default desktop.ini contents
    desktopIniContents := "[.ShellClassInfo]`nInfoTip=`n"
  }
 
  FileDelete, %desktopIniPath%
  desktopIniContents := RegExReplace(desktopIniContents, "(?<=InfoTip=).*$", comments)
 
  FileAppend, %desktopIniContents%, %desktopIniPath%
  if(ErrorLevel)
  {
    msgbox problem(%A_LastError%) appending to %desktopIniPath%
  }
  else
  {
    ; Had issues with permission, running via hidden cmd
    Run, %comspec% /c attrib +S "%folderPath%" && attrib +H +S +A "%desktopIniPath%",,Hide
  }
 
  ; Update explorer
  DllCall( "Shell32\SHChangeNotify", UInt,0x08000000, UInt,0, Int,0, Int,0 ) ; SHCNE_ASSOCCHANGED
}

RemoveFolderComments(folderPath)
{
  IniDelete, %folderPath%, .ShellClassInfo, InfoTip
}

#IfWinActive
!z::
window := ActiveExplorerWindow()
InputBox, comment, Folder Comment, Enter folder(s) comment
; if an item(s) is/are selected set the comment on all files selected
if(ExplorerItemsSelected(window))
{
  for item in window.Document.SelectedItems()
    SetFolderComments(item.Path, comment)
}
else
{
  folderPath := window.Document.Folder.Self.path
  SetFolderComments(folderPath, comment)
}

return


Note: Autohotkey is need to run this script, although you could compile it and merely have an .exe.
Script runs on: Windows 7 Professional, AutoHotkey 1.1.15.04 Unicode build

Navigation

[0] Message Index

Go to full version