![]() You can use and create any file name as per your requirements like: set SUBFILENAME=%CUR_YYYY%%CUR_MM%%CUR_DD%-%CUR_HH%%CUR_NN%%CUR_SS%Įcho "Welcome Here!" > access_%SUBFILENAME%.log Now, you have variables having current date and time in variables. Now extract the hours, minutes, seconds, and microseconds and store them in variables. Next is to parse the time which is available in 15:41:36.39 (Hours, Minutes, Seconds, and Micro Seconds) format. ![]() So use following commands to extract the date in YYYY format, month in MM format and date in DD format and stored in CUR_YYYY, CUR_MM, and CUR_DD variables correspondingly. Windows takes the date in the format like Thu. Let’s go through the tutorial and understand the process to accomplish this. For example, you are writing a script that creates backup regularly, Now you want to organize daily backups with the current date and time name, so it will be easier to identify, which folder containers backups of which date. ![]() This tutorial will help you to create files and directories with the name of the current date-time on the Windows system. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |