Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3679358
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:26:59+00:00 2026-05-19T03:26:59+00:00

Ok, so I’m not super familiar with using For /F. I can modify it

  • 0

Ok, so I’m not super familiar with using For /F. I can modify it if the file is static and has a set ammount of lines that i can skip and then pull data from. I’m currently trying to modify an .XML file. The file will have varying ammounts of lines, but will always have the following

</SyncWindow>
</AutoSyncWindows>
<SyncServiceConnections />
<DaysToRetainRecordedData>90</DaysToRetainRecordedData>
<SyncRestartRequired>false</SyncRestartRequired>
- <LastGroupsSynced>

The value for <DaysToRetainRecordedData>90</DaysToRetainRecordedData> may differ, for example <DaysToRetainRecordedData>30</DaysToRetainRecordedData>

Using tokens, what would be the most efficient way to search that .XML file for that line and overwrite it with the following <DaysToRetainRecordedData>0</DaysToRetainRecordedData>

I can not overwrite the entire .XML file as they have unique server keys that will vary from machine to machine.So I need to be able to find that line and edit the value to 0.
Any thoughts? If For /F is not the most efficient way to go, I can move to VBS if need be. But it would have to be called from pure shellcode and would make things a bit more complex.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:27:00+00:00Added an answer on May 19, 2026 at 3:27 am

    The most elegant, flexible and safe way to do this would be to download msxsl.exe and then use a tiny XSLT stylesheet to modify only the value you want in the XML:

    <!-- DaysToRetainRecordedData.xsl -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:param name="newValue" select="0" />
    
      <!-- this template copies your input XML unchanged -->
      <xsl:template match="node()|@*">
        <xsl:copy>
          <xsl:apply-templates select="node()|@*" />
        </xsl:copy>
      </xsl:template>
    
      <!-- this template changes one single value -->
      <xsl:template match="DaysToRetainRecordedData/text()">
        <xsl:value-of select="$newValue" />
      </xsl:template>
    </xsl:stylesheet>
    

    Call that on the command line with:

    msxsl.exe input.xml DaysToRetainRecordedData.xsl –o output.xml newValue=0
    

    The command line parameter newValue will show up in the XSL program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I want use html5's new tag to play a wav file (currently only supported
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm looking for suggestions for debugging... If you view this site in Firefox or
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.