' ' 引数で指定されたファイル・フォルダを ' フォルダ選択ダイアログで選択したフォルダへ移動する。 ' 当ファイル自体かそのshortcutを、SendToフォルダに置くと便利かも。 ' ' @author Jomora( kazuhiko@jomura.net http://jomura.net ) ' @version 2011.07.17 初版作成 '**Start Encode** Dim objShell ' Shell オブジェクト Dim objFSO ' FileSystem オブジェクト Dim objFolder ' 移動先フォルダ Set arg = WScript.Arguments If arg.Count = 0 Then WScript.Quit End If Set objShell = WScript.CreateObject("Shell.Application") Set objFolder = objShell.BrowseForFolder(0, "移動先フォルダを選択してください。", 0, 17) If objFolder Is Nothing Then WScript.Quit End If Set objFSO = CreateObject("Scripting.FileSystemObject") For i=0 to arg.Count - 1 ' WScript.Echo arg(i) & " -> " & objFolder.Items.Item.Path & "\" If objFSO.FolderExists(arg(i)) Then 'フォルダを移動 objShell.Namespace(objFolder.Items.Item.Path).MoveHere objShell.NameSpace(arg(i)) ElseIf objFSO.FileExists(arg(i)) Then 'ファイルを移動 objFSO.MoveFile arg(i), objFolder.Items.Item.Path & "\" End If Next Set objFolder = Nothing Set objFSO = Nothing Set objShell = Nothing