更新时间:2023-02-03 16:23:39
首先,在您进行复制时 FileToCopy 中的唯一值是最后一个.我无法解析问题以找出您需要什么,但我会先这样做:
First, the only value in FileToCopy by the time you do the copy is the last one. I'm having trouble parsing the question to figure out what you need, but I would first do this:
Dim FileToCopy(3) As String
FileToCopy(0) = "\batch\batch\ipconfigrenew.bat"
FileToCopy(1) = "\batch\batch\ipconfigrelease.bat"
FileToCopy(2) = "\batch\batch\ipconfigflushdns.bat"
Dim NewCopy As String = "C:\Batch"
Dim s As String
For Each s In FileToCopy
If System.IO.File.Exists(s) = True Then
System.IO.File.Copy(s, NewCopy)
MsgBox("File Copied")
End If
Next
接下来,我将决定是否需要以更通用的方式来编写它.
Next, I would decide if I needed to write this in a more generic way.