Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8087

Профиль | Отправить PM | Цитировать


Код: Выделить весь код
		.MoveFile .BuildPath(strPath, "*.*"), "\\server2\Destination\"
Боле подробный вариант:
Код: Выделить весь код
Option Explicit

Dim objFSO

Dim arrSources
Dim strDestination

Dim strPath

arrSources     = Array("\\server1\share1", "\\server1\share2", "\\server2\share3", "\\server2\share4")
strDestination = "\\server2\Destination"

Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")

With objFSO
	For Each strPath In arrSources
		If .FolderExists(strPath) Then
			If .GetFolder(strPath).Files.Count > 0 Then
				.MoveFile .BuildPath(strPath, "*.*"), strDestination & "\"
			Else
				WScript.Echo "Folder [" & strPath & "] not contain any files"
			End If
		Else
			WScript.Echo "Folder [" & strPath & "] not found"
		End If
	Next
End With

Set objFSO = Nothing

WScript.Quit 0

Отправлено: 23:29, 03-05-2013 | #4