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

  • SEARCH
  • Home
  • 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 7059917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:17:23+00:00 2026-05-28T04:17:23+00:00

I am fairly new to writing batch scripts. I am trying to write a

  • 0

I am fairly new to writing batch scripts. I am trying to write a script file to achieve the following task.

I have a source safe command below to get the list of files changed between two dates

ss.exe history $/myproject -Vd04/01/2012~01/01/2012 -R  

The output of the above command is as follows

Building list for $/myproject.......................................................  
....................................................................................  
...................................  

***** AllPages.master  *****  
Version 67  
User: user1              Date: 1/12/12   Time: 1:08p  
Checked in $/myproject/websites/website1
Comment:  

***** AdminTSSetup.aspx.vb *****
Version 10
User: user2              Date: 1/12/12    Time: 1:09 p
Checked in $/myproject/websites/website1
Comment: 

With the output above, I want to read the file name (allpages.master, AdminTsSetup.aspx.vb) and version of each file from the output and run the following command

SS diff -DS <filename from output> -V<version from output - 1>~<version from output>

Basically, I was trying to compare the previous version with the current version for each file in the output.

Can some one please help?

  • 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-28T04:17:24+00:00Added an answer on May 28, 2026 at 4:17 am

    This should give you what you asked for. But it seems like the diff command you specified is missing a reference to the project.

    This solution should work even if the file name contains spaces, !, ;, or any special characters like & or ^.

    @echo off
    setlocal disableDelayedExpansion
    for /f "delims=*" %%A in ('ss.exe history $/myproject -Vd04/01/2012~01/01/2012 -R ^| findstr /b "***** Version"') do (
      set "ln=%%A"
      setlocal enableDelayedExpansion
      if "!ln:~0,1!"==" " (
        for /f "eol=: delims=" %%F in ("!ln:~1!") do (
          endlocal
          set "file=%%~nxF"
        )
      ) else (
        for /f "tokens=2 delims= " %%V in ("!ln!") do (
          set /a "version1=%%V, version0=version1-1"
          ss.exe dif -DS "!file!" -V!version0!~!version1!
          endlocal
        )
      )
    )
    

    Here is a version that adds the project information from the “Checked in” line

    @echo off
    setlocal disableDelayedExpansion
    for /f "delims=*" %%A in ('ss.exe history $/myproject -Vd04/01/2012~01/01/2012 -R ^| findstr /b "***** Version Checked"') do (
      set "ln=%%A"
      setlocal enableDelayedExpansion
      if "!ln:~0,1!"==" " (
        for /f "eol=: delims=" %%F in ("!ln:~1!") do (
          endlocal
          set "file=%%~nxF"
        )
      ) else if "!ln:~0,1!"=="V" (
        for /f "tokens=2 delims= " %%V in ("!ln!") do (
          endlocal
          set /a "version1=%%V, version0=version1-1"
        )
      ) else (
        for /f "tokens=2* delims= " %%B in ("!ln!") do (
          endlocal
          set "proj=%%C"
          setlocal enableDelayedExpansion
          ss.exe dif -DS "!proj!/!file!" -V!version0!~!version1!
          endlocal
        )
      )
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I fairly new to JQuery and perhaps trying to achieve something that might be
I'm fairly new to C and have started out writing a small library with
I am fairly new to python, and have no experience with writing services for
I'm fairly new to Rails and am writing a login form. I have used
I'm fairly new to Java (been writing other stuff for many years) and unless
I'm fairly new to Java and am writing an app that needs an XML
I'm fairly new to Lift/Scala but like the ideas of less code writing and
I am fairly new to C++, having much more C experience. I am writing
I'm fairly new to ASP.NET and trying to learn how things are done. I
I'm fairly new to writing web services. I'm working on a SOAP service using

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.