Private Sub Command1_Click()
Dim WshShell,DesktopP '用于保存桌面路径
Dim Files As String, Output As String 'Output保存输出路径
Set WshShell = CreateObject("WScript.Shell")
DesktopP = WshShell.SpecialFolders("Desktop") '读取桌面路径
Output="D:\指定文件夹\" '设置目标文件夹
If Dir(Output) = "" Then MkDir Output '如果目标文件夹不存在则自动创建文件夹
Files = Dir(DesktopP & "\", vbDirectory Or vbHidden Or vbNormal Or vbReadOnly) '读取 桌面 下所有文件
While Files <> ""
If LCase(Right(Files, 4)) = ".bmp" Then '筛选bmp文件
FileCopy DesktopP & "\" + Files, Output+ Files '复制文件到d盘指定文件夹
Kill DesktopP & "\" + Files '复制后删除源文件,就是移动
End If
Files = Dir
Wend
End Sub