<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11421&amp;type=atom" />
	<updated>2016-03-17T20:29:05Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11421</id>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101914#p101914" />
			<content type="html"><![CDATA[<p>Можно ещё красивей:<br /></p><div class="quotebox"><blockquote><p><a href="http://www.softspecialists.com/DownloadHandler.ashx?pg=7ee0e215-f530-427c-957d-fc0b0546d95d&amp;section=a2fde6a7-e2e5-4409-be50-f0519ab65207&amp;file=TxtReplace.zip">TxtReplace.exe</a> Web.config password=&quot;admin password=&quot;smenapass</p></blockquote></div><p>А ещё есть far (меньше gsar), но кавычки экранировать не хочет. <img src="//forum.script-coding.com/img/smilies/hmm.png" width="15" height="15" /><br />А вообще для работы с xml оптимальной тулзой считается <a href="http://www.html-tidy.org/">Tidy</a>.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2016-03-17T20:29:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101914#p101914</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101897#p101897" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Flasher пишет:</cite><blockquote><p>gsar.exe -spassword=&quot;&quot;&quot;admin -rpassword=&quot;&quot;&quot;smenapass -o Web.config</p></blockquote></div><p>Красиво.</p>]]></content>
			<author>
				<name><![CDATA[ReVeRSeR]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33761</uri>
			</author>
			<updated>2016-03-17T16:00:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101897#p101897</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101894#p101894" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>gsar.exe -spassword=&quot;&quot;&quot;admin -rpassword=&quot;&quot;&quot;smenapass -o Web.config</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2016-03-17T15:30:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101894#p101894</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101893#p101893" />
			<content type="html"><![CDATA[<p>Можно из бата вызвать <strong>PowerShell</strong>:<br /></p><div class="codebox"><pre><code>@powershell /nop /ex bypass &quot;&amp;{[Regex]::Replace([IO.File]::ReadAllText(file_full_path), &#039;(?&lt;=admin.*)admin&#039;, &#039;changepass&#039;)}&quot;</code></pre></div><p>или <strong>sed</strong>, если есть Cygwin:<br /></p><div class="codebox"><pre><code>sed &#039;s/admin/changepass/2&#039; file</code></pre></div><p>и перенаправить вывод в файл. На чистом командном языке реализовывать сие слишком утомительно.</p>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2016-03-17T14:37:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101893#p101893</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101890#p101890" />
			<content type="html"><![CDATA[<p>Добрый день.<br />Не могу понять как написать скрипт по изменению строки в файле.<br />У меня есть файл Web.config в котором некоторый текст:<br /></p><div class="codebox"><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;configuration&gt;
  &lt;configSections&gt;
    &lt;section name=&quot;log4net&quot; type=&quot;log4net.Config.Log4NetConfigurationSectionHandler, log4net&quot; /&gt;
    &lt;section name=&quot;rewriter&quot; requirePermission=&quot;false&quot; type=&quot;Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter&quot; /&gt;
    &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
  &lt;/configSections&gt;
  &lt;rewriter configSource=&quot;WebRewriter.config&quot; /&gt;
  &lt;connectionStrings configSource=&quot;WebConnections.config&quot; /&gt;
  &lt;log4net configSource=&quot;WebLogging.config&quot; /&gt;
  &lt;appSettings configSource=&quot;WebSettings.config&quot; /&gt;
  &lt;system.web&gt;
    &lt;authentication mode=&quot;Forms&quot;&gt;
      &lt;forms loginUrl=&quot;~/service_config/Account/Login.aspx&quot; timeout=&quot;2880&quot;&gt;
        &lt;credentials passwordFormat=&quot;Clear&quot;&gt;
          &lt;user name=&quot;admin&quot; password=&quot;admin&quot; /&gt;
        &lt;/credentials&gt;
      &lt;/forms&gt;
    &lt;/authentication&gt;
    &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.5&quot;&gt;
    &lt;/compilation&gt;
    &lt;httpModules&gt;
      &lt;add type=&quot;Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter&quot; name=&quot;UrlRewriter&quot; /&gt;
    &lt;/httpModules&gt;
    &lt;pages controlRenderingCompatibilityVersion=&quot;4.0&quot; /&gt;
    &lt;caching&gt;
      &lt;outputCacheSettings&gt;
        &lt;outputCacheProfiles&gt;
          &lt;!--test--&gt;
          &lt;add name=&quot;10seconds&quot; duration=&quot;10&quot; varyByHeader=&quot;Accept&quot; varyByParam=&quot;guid&quot; /&gt;
        &lt;/outputCacheProfiles&gt;
      &lt;/outputCacheSettings&gt;
    &lt;/caching&gt;
  &lt;/system.web&gt;
&lt;/configuration&gt;
</code></pre></div><p>Из всего этого кода мне надо найти строку<br /></p><div class="codebox"><pre><code>&lt;user name=&quot;admin&quot; password=&quot;admin&quot; /&gt;</code></pre></div><p>И заменить её на<br /></p><div class="codebox"><pre><code>&lt;user name=&quot;admin&quot; password=&quot;smenapass&quot; /&gt;</code></pre></div><p>Как решить данную задачу не могу понять.</p><p>Заранее спасибо за помощь.</p>]]></content>
			<author>
				<name><![CDATA[ReVeRSeR]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33761</uri>
			</author>
			<updated>2016-03-17T12:36:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101890#p101890</id>
		</entry>
</feed>
