Имя пользователя:
Пароль:
 

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

Ветеран


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

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


Гмм… А почему Вы его обозвали test1.vbs ?

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

Dim strSourceFile
Dim strRestoreFile

Dim objFSO


strSourceFile = "C:\prog\test1.xml"
strRestoreFile = "D:\waq\test_new.xml"

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

If objFSO.FileExists(strSourceFile) Then
	If objFSO.FileExists(strRestoreFile) Then
		With WScript.CreateObject("Microsoft.XMLDOM")
			.load strSourceFile
			
			If Not .selectSingleNode("/head/Postgre[Server = '192.168.0.11']") Is Nothing Then
				objFSO.CopyFile strRestoreFile, strSourceFile, True
			End If
		End With
	Else
		WScript.Echo "Can't find file for restore [" & strRestoreFile & "]."
		WScript.Quit 2
	End If
Else
	WScript.Echo "Can't find source file [" & strSourceFile & "]."
	WScript.Quit 1
End If

Set objFSO = Nothing

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

Отправлено: 14:20, 28-02-2017 | #4