星期一, 9月 05, 2011

在 Windows 中快速建立當日日期為名稱的資料夾

功能很簡單就是可以按右鍵快速產生以日期為名的資料夾方便整理資料,

功能看下面兩章圖就會了解

image

image

要達成這功能需要三個檔案,
三個檔案內容如下

mkdirByDate.bat

此檔案用來產生資料夾格式如果不滿意可以自行修改
====================
FOR /F "tokens=1-3 delims=/ " %%a IN ("%date%") DO (
SET _MyDate=%%a%%b%%c%
)
md %_MyDate%
exit
====================

install.reg
若希望修改出現在右鍵選單內的名稱請自行修改,
另外如果你的 mkdirByDate.bat 並非在 C:\mkdirByDate.bat
也請自行修改路徑
====================
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\建立當日資料夾\command]
@="c:\\windows\\system32\\cmd.exe /k \"C:\\mkdirByDate.bat\""
====================

uninstall.reg
====================
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\Background\shell\建立當日資料夾]
====================

把 mkdirByDate.bat 擺在正確的位置,
並且點兩下 install.reg 匯入登錄檔後在資料夾內按右鍵,
此時會出現 "建立當日資料夾" 選項,
選擇後會在目前資料夾內建立當日日期的資料夾,
之後不想要這功能請執行 uninstall.reg
這樣 "建立當日資料夾" 選項就會被移除,
(另外請自行刪除mkdirByDate.bat)