Page 1 of 1

bat change the date one year

Posted: 16 Oct 2014 00:07
by facescreen
hi, I just joined this forum queso and my first post, I am a php programmer, I do not know much about m-dos, should I create a bat file that when launched I change the date of the calendar year but only ess: date * / * / 2013

Re: bat change the date one year

Posted: 16 Oct 2014 00:41
by foxidrive
To get an exact answer you need to provide the actual situation which needs to be edited or modified.

A batch file can change a string, but the way it is being changed and the makeup of the string is important.

Re: bat change the date one year

Posted: 16 Oct 2014 02:09
by facescreen
then I try to do all that and a script dos, that when opened, will change the system date but only one year, not the day, to change just one year

Re: bat change the date one year

Posted: 16 Oct 2014 02:13
by foxidrive
The date command does that at the command prompt.

Type date /? for help.

Re: bat change the date one year

Posted: 16 Oct 2014 06:36
by Squashman
facescreen wrote:I do not know much about m-dos,

Good thing. Shouldn't be using MS-DOS anymore anyways.

Re: bat change the date one year

Posted: 16 Oct 2014 10:00
by facescreen
then perhaps I can not explain I can relate if at least I can understand I do not speak English well? :cry: everything I have asked for and if there is a way to change only the date of the calendar year but only without the days or months, ess: if I write (date 01/01/2015) changes the date 01/01/2015 in the calendar, is there a way to change just one year without the day and the month? like so: (date %%/%%/2013)

Re: bat change the date one year

Posted: 16 Oct 2014 10:35
by Yury

Code: Select all

@echo off

set year=2015

for /f "tokens=1,2 delims=.-/" %%i in ("%date%") do date %%i/%%j/%year%

exit /b



Run as administrator.

Re: bat change the date one year

Posted: 16 Oct 2014 11:34
by facescreen
Yuri with 1000 :D :D :D :D :D :D you very god ms-dos

Re: bat change the date one year

Posted: 16 Oct 2014 11:49
by Squashman
facescreen wrote:Yuri with 1000 :D :D :D :D :D :D you very god ms-dos

Incorrect. He is very good with batch files.

Re: bat change the date one year

Posted: 16 Oct 2014 13:07
by ShadowThief
Squashman wrote:
facescreen wrote:Yuri with 1000 :D :D :D :D :D :D you very god ms-dos

Incorrect. He is very good with batch files.

You're going to confuse the poor guy.

I feel like somebody should explain to Oleg that there's a difference between MS-DOS and the modern Windows command line. MS-DOS is an operating system that's very rarely used anymore and its command line is command.com, which is a 16-bit program that has limited scripting capabilities compared to the modern command line. The modern command line is cmd.exe, which is a 32-bit program.