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

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

Ветеран


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

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


Примерно так:
читать дальше »
Код: Выделить весь код
Option Explicit

Dim strSourceFile
Dim strDestFolder

Dim strDestFile


strSourceFile   = "C:\tmp-img\1.jpg"
strDestFolder   = "C:\img"

With WScript.CreateObject("Scripting.FileSystemObject")
	If .FileExists(strSourceFile) Then
		If .FolderExists(strDestFolder) Then
			strDestFile = .BuildPath(strDestFolder, .GetFileName(strSourceFile))
			
			If .FileExists(strDestFile) Then
				If WScript.CreateObject("WScript.Shell").Run("fc.exe /b """ & strSourceFile & """ """ & strDestFile & """", 0, True) <> 0 Then
					.CopyFile strSourceFile, strDestFile, True
				End If
			Else
				.CopyFile strSourceFile, strDestFile
			End If
		Else
			WScript.Echo "Can't find destination folder [" & strDestFolder & "]."
			WScript.Quit 2
		End If
	Else
		WScript.Echo "Can't find source file [" & strSourceFile & "]."
		WScript.Quit 1
	End If
End With

WScript.Quit 0
Это сообщение посчитали полезным следующие участники:

Отправлено: 08:15, 27-01-2014 | #2