4/17/2023 0 Comments Xp batch file rename![]() In our example it’s 2, as we need to extract just 7 th and 8 th character in the string. With second value we will indicate length of the substring. We will indicate position of first character with value of X. The x and y are number position and length. We can add :~x,y behind variable name, inside % signs, to tell the batch interpreter that we want just the part of the value, not whole variable value. It’s on 8 th character in the string and that’s position 7. Also, we counted position of that information. Now we need just part of this output (the date string) for out variable named DAY. In our first example we saw that we can display a current day with command ECHO %date% We will analyze further first line: set day=%date:~7,2% Main part of this batch is done in the first three lines beginning with the command SET. I made another batch file, named get_today_date.bat, which will demonstrate this operation. Now that we know what we need to extract, we can use this to write our batch file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |