
[已解決]右擊資源管理器文件夾內空白處新建txttxt內直接包含剪貼板中的內容最后由 lforl 于 -10-23 21:34不太想用scripting.FileSystemObject。想純粹的cmd寫入reg。調用了第三方cmd:nircmd。基于3樓 @Five66 大佬的方案,改造了右鍵菜單新建文本文檔。特點:完美隱藏了運行窗口;如果遇到重名自動加(1);新建后自動刷新當前文件夾;代碼精簡。
基于6樓 @77七 大佬的方案,改造了右鍵菜單新建文本文檔。特點:直接在資源管理器的空白背景上右鍵菜單顯示,很直觀。不用額外控制,自動刷新顯示新建文件。nclick="copycode($('code0'));">復制代碼
- Windows Registry Editor Version 5.00
- [HKEY_CLASSES_ROOT.txtShellNew]
- ItemName=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,
- 6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,
- 00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,2c,00,
- 2d,00,34,00,37,00,30,00,00,00
- Command=nircmd exec hide cmd /c nircmd clipboard writefile %1 &(nircmd wait 150)& (nircmd shellrefresh)
- ;或者用powershell
- ;Command=nircmd exec hide powershell -c nircmd clipboard writefile '%1' (nircmd wait 300) (nircmd shellrefresh)
感謝樓下幾位熱心的大佬幫助!總結為以上方案,以備忘和待有需要的有緣人獲取。nclick="copycode($('code1'));">復制代碼
- Windows Registry Editor Version 5.00
- [HKEY_CLASSES_ROOTDirectoryBackgroundshellcliptotxt]
- @=生成txt來自剪貼板(&T)
- Icon=imageres.dll,-5304
- [HKEY_CLASSES_ROOTDirectoryBackgroundshellcliptotxtcommand]
- @=nircmd exec hide cmd /c nircmd clipboard addfile 新建文本.txt

