1.

Solve : Creating different version in a folder?

Answer» <html><body><p>Hi All,<br/><br/>   I have a batch script which will create a folder in 20100810(yyyyddmm) format. Here is my below requirements<br/><br/>1. We have some files which is modified in daily basses, so i will be creating the folder as above and copy the modified into the newly created folder using a batch file.<br/><br/>2. But now a days modification of files are increases(<a href="https://interviewquestions.tuteehub.com/tag/upto-239131" style="font-weight:bold;" target="_blank" title="Click to know more about UPTO">UPTO</a> 5 times or more). according to the changes i need a batch script to check the folder for that day is created are not? If so we need create a folder inside the 20100810 folder <a href="https://interviewquestions.tuteehub.com/tag/like-537196" style="font-weight:bold;" target="_blank" title="Click to know more about LIKE">LIKE</a> version<strong>(20100810-v1)</strong>. At the end of the day we can see how many versions(changes) are done.<br/><br/>Please help me on this.<br/><br/>Thanks &amp; Regards<br/>PaulwintechThis little spit of <a href="https://interviewquestions.tuteehub.com/tag/code-25512" style="font-weight:bold;" target="_blank" title="Click to know more about CODE">CODE</a> might help:<br/><br/> Code: <a>[Select]</a>echo off<br/>setlocal enabledelayedexpansion<br/><br/>set folder=c:\temp<br/>set yy=%date:~10,4%<br/>set mm=%date:~4,2%<br/>set dd=%date:~7,2%<br/><br/>:loop<br/>  set /a seq+=1<br/>  if exist %folder%\%yy%%mm%%dd%-<a href="https://interviewquestions.tuteehub.com/tag/v-238055" style="font-weight:bold;" target="_blank" title="Click to know more about V">V</a>!seq! goto loop<br/>  <br/><a href="https://interviewquestions.tuteehub.com/tag/md-244173" style="font-weight:bold;" target="_blank" title="Click to know more about MD">MD</a> %folder%\%yy%%mm%%dd%-v%seq%<br/><br/>My system date format is <strong>dow mm/dd/yyyy</strong>. You may have to tweak how <em>yy, mm, dd</em> are assigned. Also change the <strong>folder</strong> value to something that matches your environment.<br/><br/>Not for nothing, but why not simply concatenate the time to the date and name your folders that way. Just a thought.<br/><br/>Good luck.  Thank you very much..... <br/><br/>Regards<br/>Paulwintech</p></body></html>


Discussion

No Comment Found