デジカメの画像を、指定のフォルダの下に、日付形式のフォルダを作り、そこに連番で名前を変更して移動するスクリプトを作ってみた。
なんかあんまり汎用性がない気もするけど、まぁそれなりに使えるかなぁ。 Option Explicit '********************************************* ' 必要な定数の設定 ' srcFolderName :デジカメの画像のフォルダのパスを指定 ' dstFolderName :デジカメの画像ファイルを移動するパスを指定 ' intFig :画像ファイルの連番を振る際の数字の桁数 '********************************************** Const srcFolderName = "D:\DCIM\100MSDCF" Const dstFolderName = "C:\temp" Const intFig = 3 Dim objFS Dim objSubFLD Dim strFile Dim intCount Dim strNewPath Dim chkFolder Set objFS = CreateObject("Scripting.FileSystemObject") Set objSubFLD = objFS.GetFolder(srcFolderName) intCount = 1 For each strFile in objSubFLD.Files strNewPath = makeNewFolderPath & "\" & ModifyDigit(intCount) & ".jpg" strFile.Move strNewPath intCount = intCount + 1 Next Wscript.Echo "終了" Function makeNewFolderPath() Dim arrDate Dim strFLDName Dim tmpFLDName arrDate = split(date(),"/") For each tmpFLDName in arrDate strFLDName = strFLDName & tmpFLDName next chkFolder = dstFolderName & "\" & strFLDName If objFS.FolderExists(chkFolder) = False Then objFS.CreateFolder chkFolder End If makeNewFolderPath = chkFolder End Function Function ModifyDigit(strFig) Dim strBuffer strBuffer = right(string(intFig,"0") & strFig, intFig) ModifyDigit = strBuffer End Function
by h5y1m141
| 2004-12-26 21:27
| 業界動向
|
他のブログやツールなど
タグ
読書メモ(186)
ビジネス(60) 日記(51) キャリア(44) ネタ(40) lifehacks(31) script(24) お店(22) money(21) 料理(19) IT(16) 4行日記(16) TIPS(15) relax(15) イベント(14) 写真(11) js(7) perl(6) wmi(6) パン(6) 以前の記事
2009年 08月 2009年 07月 2009年 06月 2009年 05月 2009年 04月 2009年 03月 2009年 02月 2009年 01月 2008年 12月 2008年 11月 2008年 10月 2008年 09月 2008年 08月 2008年 07月 2008年 06月 2008年 05月 2008年 04月 2008年 03月 2008年 02月 2008年 01月 2007年 12月 2007年 11月 2007年 10月 2007年 09月 2007年 08月 2007年 07月 2007年 06月 2007年 05月 2007年 04月 2007年 03月 2007年 02月 2007年 01月 2006年 12月 2006年 11月 2006年 10月 2006年 09月 2006年 08月 2006年 07月 2006年 06月 2006年 05月 2006年 04月 2006年 03月 2006年 02月 2006年 01月 2005年 12月 2005年 11月 2005年 10月 2005年 09月 2005年 08月 2005年 07月 2005年 06月 2005年 05月 2005年 04月 2005年 03月 2005年 02月 2005年 01月 2004年 12月 2004年 07月 最新のトラックバック
その他のジャンル
ファン
記事ランキング
ブログジャンル
画像一覧
|
ファン申請 |
||