Hi Antonio
Thank you very much. You saved my day
there was just one issue. the delims sign is in my computer not "/" but "."
So, now it seems to work. Will do the test with January, but I'm pretty sure this will work too.
thanks again.
br, chris
Search found 4 matches
- 08 Jun 2013 11:31
- Forum: DOS Batch Forum
- Topic: set variable 2012 (currentyear - 1)
- Replies: 12
- Views: 10397
- 08 Jun 2013 11:11
- Forum: DOS Batch Forum
- Topic: set variable 2012 (currentyear - 1)
- Replies: 12
- Views: 10397
Re: set variable 2012 (currentyear - 1)
the goal is to have two variables: month=05 year=2013 with this variables the rest of the script is creating folders and files with the year and month of the previous month So, when I run this script today (June 2013) I want to write the folder: Folder1_abc_ 201305 Folder9_xyz_ 201305 I will try now...
- 08 Jun 2013 01:19
- Forum: DOS Batch Forum
- Topic: set variable 2012 (currentyear - 1)
- Replies: 12
- Views: 10397
Re: set variable 2012 (currentyear - 1)
@Aacini, thank you very much. works like a charm one other question. How can I simplify the same thing with the month? It is working as follows, but should be possible with 1-2 lines code instead of 12. set currentmonth=%date:~3,2% if "%currentmonth%" == "01" (set month=05) if &q...
- 07 Jun 2013 15:33
- Forum: DOS Batch Forum
- Topic: set variable 2012 (currentyear - 1)
- Replies: 12
- Views: 10397
set variable 2012 (currentyear - 1)
Hi there I need to have a variable which contains the last year: set year=2012 Here is what I have tested so far. set currentyear=%date:~6,4% :CHANGE2LASTYEAR set /A %currentyear%-1 >%temp%\year.txt set /P year=<%temp%\year.txt Actualy this is working in a dos window, but not in a script. (set /a) s...