Vbscript 复制文件,然后重命名VBS

Vbscript 复制文件,然后重命名VBS,vbscript,Vbscript,所以,我让一个用户帮我重命名文件,这太棒了 代码如下: Set fso = WScript.CreateObject("Scripting.FileSystemObject") Set fol = fso.GetFolder("F:\Downloads") For Each fil In fol.Files 'may need to specify a comparison If InStr(1, fil.Name, "tv show bob - 13", vbTextCompare)

所以,我让一个用户帮我重命名文件,这太棒了

代码如下:

 Set fso = WScript.CreateObject("Scripting.FileSystemObject")
 Set fol = fso.GetFolder("F:\Downloads")

 For Each fil In fol.Files
'may need to specify a comparison
If InStr(1, fil.Name, "tv show bob - 13", vbTextCompare) <> 0 Then
    ext = fso.GetExtensionName(fil)
    If Len(ext) > 0 Then ext = "." & ext
    sName = "tv show bob S03E13" & ext
    fil.Name = sName
  End If
Next

 WScript.Echo "Completed!"

我想知道是否可以让它复制文件,然后使用代码的第一部分粘贴重命名的版本。谢谢你的帮助:我不明白。。。你是说你有所有的代码,你只需要有人帮你把它们组合起来?很抱歉打断您,但这是您的工作。不要在
if
语句、
CopyFile
方法等中使用文字。将文字值指定给适用的命名变量,解决方案将自动显示。。。把你的第一部分代码写成一个
函数
子过程。>我不明白。。。你是说你有所有的代码,你只需要有人帮你把它们组合起来?很抱歉告诉你,那是你的工作。不,我不是说…代码工作得很好,但它需要一些调整才能使用torrents。
If (objFSO.FileExists("D:\TV Shows\tv\tv show S01E02.mkv")) Then
Else
objFSO.CopyFile "D:\Downloads\tv show - 02 [1080p].mkv", "D:\TV Shows\tv\tv show S01E02.mkv"
End If