想寫個vbScript 腳本 但是對vbScript 不了解 求大神幫幫忙
現在有一堆 圖片檔案a12345.jpg a12546.jpg a1368.jpg a1389.jpg …………
寫個vbScript 腳本 能夠自動創建檔案夾a1 在a1檔案夾內創建a12檔案夾 把a12345.jpg 和a12546.jpg 等
a12開頭的JPG檔案都移進a12檔案夾內
同樣 在a1檔案夾內自動創建 a13檔案夾 把a12546.jpg a1368.jpg a1389.jpg …等都移進去 如此類推
uj5u.com熱心網友回復:
圖片檔案什么位置你又不說我默認你是一個目錄里面
等會給你寫個
uj5u.com熱心網友回復:
on error resume next
Set ws=WScript.CreateObject("wscript.shell")
w=ws.CurrentDirectory
Set fso=WScript.CreateObject("scripting.filesystemobject")
set oFolder = fso.GetFolder(w)
set oFiles = oFolder.Files
fso.CreateFolder w &"\a1"
For Each uu In oFiles
if instr(uu,"a12")>0 then
fso.CreateFolder w &"\a1\a12"
fso.CopyFile uu,w &"\a1\a12\"& uu.name
elseif instr(uu,"a13")>0 then
fso.CreateFolder w &"\a1\a13"
fso.CopyFile uu,w &"\a1\a13\"& uu.name
end if
Next
這只寫了a12 a13
你后面要加a14之類的
end if之前加
elseif instr(uu,"a14")>0 then
fso.CreateFolder w &"\a1\a14"
fso.CopyFile uu,w &"\a1\a14\"& uu.name
就可以了
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/80904.html
標籤:VB基礎類
上一篇:想設計一個軟體,資料庫是在線型別的,大神有什么好的可以推薦嗎?
下一篇:vbs基礎類撰寫一個簡單函式
