VBS脚本或批处理,如何根据列表文件批量复制指定文件 目录结构不变
请问如何根据列表文件,例如list.txt,内容如下:list.txt---------------------begin---------------------d:\...
请问如何根据列表文件, 例如list.txt, 内容如下:
list.txt
---------------------begin---------------------
d:\game\qq\bin\qq.exe
---------------------end-----------------------
参考
On Error Resume Next
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objfso.OpenTextFile("d:\rpt\lists.txt",1)
strYear = Year(Date)
strMonth = Month(Date)
If strMonth < 10 Then
strMonth = "0" & strMonth
End If
strDay = Day(Date)
If strDay < 10 Then
strDay = "0" & strDay
End If
strToday = strYear & strMonth &strDay
Do Until objFile.AtEndOfStream
strTemp = objFile.ReadLine
objfso.CopyFile "d:\rpt\" & strToday & "\" & strTemp,"e:\rpt\",True
Loop 展开
list.txt
---------------------begin---------------------
d:\game\qq\bin\qq.exe
---------------------end-----------------------
参考
On Error Resume Next
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objfso.OpenTextFile("d:\rpt\lists.txt",1)
strYear = Year(Date)
strMonth = Month(Date)
If strMonth < 10 Then
strMonth = "0" & strMonth
End If
strDay = Day(Date)
If strDay < 10 Then
strDay = "0" & strDay
End If
strToday = strYear & strMonth &strDay
Do Until objFile.AtEndOfStream
strTemp = objFile.ReadLine
objfso.CopyFile "d:\rpt\" & strToday & "\" & strTemp,"e:\rpt\",True
Loop 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询