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

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

Ветеран


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

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


На WSH:
Скрытый текст
Код: Выделить весь код
Option Explicit

Dim strSourceFile
Dim strDestPath
Dim strDestFile


strSourceFile = "D:\verid\derat_env.dat"
strDestPath   = "D:\tirols"
strDestFile   = "test.txt"

With WScript.CreateObject("Scripting.FileSystemObject")
	If .FileExists(strSourceFile) Then
		If .FolderExists(strDestPath) Then
			If DateDiff("h", .GetFile(strSourceFile).DateLastModified, Now()) > 0 Then
				.CreateTextFile(.BuildPath(strDestPath, strDestFile), True).Close
			End If
		Else
			WScript.Echo "Can't find destination folder [" & strDestPath & "]."
			WScript.Quit 2
		End If
	Else
		WScript.Echo "Can't find source file [" & strSourceFile & "]."
		WScript.Quit 1
	End If
End With

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

Отправлено: 18:14, 29-08-2019 | #6