Skip to content

Instantly share code, notes, and snippets.

@micycle1
Created April 13, 2025 15:04
Show Gist options
  • Select an option

  • Save micycle1/81a31ad8d7055f4ffba3ca0a24554049 to your computer and use it in GitHub Desktop.

Select an option

Save micycle1/81a31ad8d7055f4ffba3ca0a24554049 to your computer and use it in GitHub Desktop.

Revisions

  1. micycle1 created this gist Apr 13, 2025.
    30 changes: 30 additions & 0 deletions Copy Contents to Clipboard.reg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    Windows Registry Editor Version 5.00

    ; Step 1: Remove type-specific keys added by the old version of this script
    [-HKEY_CLASSES_ROOT\batfile\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\cmdfile\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\SystemFileAssociations\.css]
    [-HKEY_CLASSES_ROOT\htmlfile\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\SystemFileAssociations\.html\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\JSFile\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\CopyContents]
    [-HKEY_CLASSES_ROOT\regfile\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\rtffile\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\SystemFileAssociations\.txt\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\textfile\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\txtfile\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\txtfilelegacy\shell\CopyContents]
    [-HKEY_CLASSES_ROOT\VBSFile\shell\CopyContents]

    ; Step 2: Add context menu item for all files
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\CopyContents]
    "Icon"="DxpTaskSync.dll,-52"
    "MUIVerb"="Copy Contents to Clipboard"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\CopyContents\command]
    @="cmd /c clip <\"%1\""

    ; Step 3: This was in the original type-specific code. Is it important?
    ;For CSS files
    [HKEY_CLASSES_ROOT\SystemFileAssociations\.css]
    "PerceivedType"="document"