Jump to content

darksimoon

Member
  • Posts

    116
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Turkey

Everything posted by darksimoon

  1. Thank you very much Jaklaz. I adapted my batch file accordingly thanks to your kind help. And it works like charm
  2. Dear Jaclaz, Thank you again. These subjects are a little complicated for me, so sometimes I prefer to use template solutions and for such cases I ask my questions here. this time I chanced my template as follows: set YMD=%date:~-4%.%date:~3,2%.%date:~0,2% SET Now=%Time: =0% set HM=%Now:~0,2%.%now:~3,2% SET BackUpTime=%HM% SET file=%YMD%-[%BackUpTime%]-FLAMENT.rar echo %file% --> 2016.09.21-[07.53]-FLAMENT.rar I think it is OK! but what I don't understand is why did you add followings after SET Now=%Time: =0% ? I wonder this because I couldn't see any %Hours% or %Minutes% variables in the afterwards usage. This is why I excluded. SET Hours=%Now:~0,2% SET Minutes=%Now:~3,2% Best Regards
  3. Hello Friends, I have following variable inside a batch file, but somehow there is an extra space in the output as seen in the attached file. (I also added sample batch file) I checked the possible spaces inside batch file but everything seems OK. how can I prevent this space to happen ? Edited 1: I've just realized that sometimes it doesn't make any space and works well. So I don't understand when it works and if it works, how it works Edited 2: This time I've realized that it is about time format. when the hour is before 10:00, the time format doesn't show zero like 09.15. Instead it shows only 9.15 and puts a space instead of zero and this space which is put instead of zero causes the problem. So how can I solve this interesting problem ? Best Regards Note : I know that I shouldn't use dots and parenthesis for naming files when using batch file but I think this space isn't caused by dots or parenthesis. set YMD=%date:~-4%.%date:~3,2%.%date:~0,2% SET Now=%TIME% set HM=%Now:~0,2%.%now:~3,2% SET "BackUpTime=%HM%" SET file=%YMD%-(%BackUpTime%)-FLAMENT.rar echo %file% 2016.09.20-( 9.30)-FLAMENT.rar space takes place between "(" and "9" extra space.cmd
  4. Dear Jaclaz, I thank you a million times for this. You helped me again as before. thanks to information you provide me, I will be able to improve my batch file much more efficiently. thank you again. Best Regards
  5. Hello friends, I have a basic level at batch files. In one of my bacth file I use below variable for naming my backup file whose name is "2016.08.16-(08.30)-FLAMENT.rar" set HM=%time:~0,2%.%time:~3,2% echo (%HM%) --produces--> (08.30) The problem is that I want to use the same time (08.30) for the other file which related to the previous one. But since the time changes throughout the process in the same batch file, %HM% produces (08.32), not (08.30) for the time changed. how can I use same time for all processes thoughout the batch file ? I mean, I want %HM% to produce same result once the batch file runs until it finishes although the time changes. How can I do this ? Best Regards
×
×
  • Create New...