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

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

Ветеран


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

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


firstarey, пробуйте WSH:
читать дальше »
Код: Выделить весь код
Option Explicit

Dim strFile
Dim objNode

If WScript.Arguments.Count = 1 Then
	strFile = WScript.Arguments.Item(0)
	
	If WScript.CreateObject("Scripting.FileSystemObject").FileExists(strFile) Then
		With WScript.CreateObject("MSXML2.DOMDocument")
			.async = False
			.load strFile
			
			If .parseError.errorCode = 0 Then
				For Each objNode In .childNodes
					If objNode.nodeType = 7 Then
						If objNode.baseName = "xml-stylesheet" Then
							If objNode.data = "type=""text/xsl"" href=""https://portal.rosreestr.ru/xsl/GKN/Vidimus/04/common.xsl""" Then
								WScript.Echo "Node found"
								
								objNode.data = "type=""text/xsl"" href=""\\serv\папки\xml\common.xsl"""
								
								Exit For
							End If
						End If
					End If
				Next
			Else
				WScript.Echo "Error [" & .parseError.errorCode & "] in xml [" & strFile & "]"
			End If
			
			.save strFile
		End With
	Else
		WScript.Echo "File [" & strFile & "] not found"
	End If
Else
	WScript.Echo "Usage: " & WScript.ScriptName & " <xml-file>"
End If

WScript.Quit 0


Update: Забыл про:
Цитата firstarey:
вторая задача:
запустить IE в автономном режиме на просмотр этого файла »
читать дальше »
Код: Выделить весь код
Option Explicit

Const READYSTATE_COMPLETE = 4

Dim strFile
Dim objNode
Dim objIE


If WScript.Arguments.Count = 1 Then
	strFile = WScript.Arguments.Item(0)
	
	If WScript.CreateObject("Scripting.FileSystemObject").FileExists(strFile) Then
		With WScript.CreateObject("MSXML2.DOMDocument")
			.async = False
			.load strFile
			
			If .parseError.errorCode = 0 Then
				For Each objNode In .childNodes
					If objNode.nodeType = 7 Then
						If objNode.baseName = "xml-stylesheet" Then
							If objNode.data = "type=""text/xsl"" href=""https://portal.rosreestr.ru/xsl/GKN/Vidimus/04/common.xsl""" Then
								WScript.Echo "Node found"
								
								objNode.data = "type=""text/xsl"" href=""\\serv\папки\xml\common.xsl"""
								
								.save strFile
								
								Exit For
							End If
						End If
					End If
				Next
			Else
				WScript.Echo "Error [" & .parseError.errorCode & "] in xml [" & strFile & "]"
			End If
		End With
		
		With WScript.CreateObject("InternetExplorer.Application")
			.Navigate("file:///" & strFile)
			
			Do
				WScript.Sleep 100
			Loop Until Not .Busy And .ReadyState = READYSTATE_COMPLETE
			
			.Visible = True
		End With
	Else
		WScript.Echo "File [" & strFile & "] not found"
	End If
Else
	WScript.Echo "Usage: " & WScript.ScriptName & " <xml-file>"
End If

WScript.Quit 0

Последний раз редактировалось Iska, 18-09-2012 в 11:06.

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

Отправлено: 10:55, 18-09-2012 | #6