<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=11421</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11421&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «CMD/BAT: Как сделапть изменение данных в строке XML-файла».]]></description>
		<lastBuildDate>Thu, 17 Mar 2016 20:29:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101914#p101914</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Thu, 17 Mar 2016 20:29:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101914#p101914</guid>
		</item>
		<item>
			<title><![CDATA[Re: CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101897#p101897</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (ReVeRSeR)]]></author>
			<pubDate>Thu, 17 Mar 2016 16:00:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101897#p101897</guid>
		</item>
		<item>
			<title><![CDATA[Re: CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101894#p101894</link>
			<description><![CDATA[<div class="codebox"><pre><code>gsar.exe -spassword=&quot;&quot;&quot;admin -rpassword=&quot;&quot;&quot;smenapass -o Web.config</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Thu, 17 Mar 2016 15:30:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101894#p101894</guid>
		</item>
		<item>
			<title><![CDATA[Re: CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101893#p101893</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (greg zakharov)]]></author>
			<pubDate>Thu, 17 Mar 2016 14:37:44 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101893#p101893</guid>
		</item>
		<item>
			<title><![CDATA[CMD/BAT: Как сделапть изменение данных в строке XML-файла]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=101890#p101890</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (ReVeRSeR)]]></author>
			<pubDate>Thu, 17 Mar 2016 12:36:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=101890#p101890</guid>
		</item>
	</channel>
</rss>
