bat change the date one year

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
facescreen
Posts: 7
Joined: 15 Oct 2014 23:49
Location: italy
Contact:

bat change the date one year

#1 Post by facescreen » 16 Oct 2014 00:07

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: bat change the date one year

#2 Post by foxidrive » 16 Oct 2014 00:41

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.

facescreen
Posts: 7
Joined: 15 Oct 2014 23:49
Location: italy
Contact:

Re: bat change the date one year

#3 Post by facescreen » 16 Oct 2014 02:09

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: bat change the date one year

#4 Post by foxidrive » 16 Oct 2014 02:13

The date command does that at the command prompt.

Type date /? for help.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: bat change the date one year

#5 Post by Squashman » 16 Oct 2014 06:36

facescreen wrote:I do not know much about m-dos,

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

facescreen
Posts: 7
Joined: 15 Oct 2014 23:49
Location: italy
Contact:

Re: bat change the date one year

#6 Post by facescreen » 16 Oct 2014 10:00

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)

Yury
Posts: 115
Joined: 28 Dec 2013 07:54

Re: bat change the date one year

#7 Post by Yury » 16 Oct 2014 10:35

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.

facescreen
Posts: 7
Joined: 15 Oct 2014 23:49
Location: italy
Contact:

Re: bat change the date one year

#8 Post by facescreen » 16 Oct 2014 11:34

Yuri with 1000 :D :D :D :D :D :D you very god ms-dos

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: bat change the date one year

#9 Post by Squashman » 16 Oct 2014 11:49

facescreen wrote:Yuri with 1000 :D :D :D :D :D :D you very god ms-dos

Incorrect. He is very good with batch files.

ShadowThief
Expert
Posts: 1167
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: bat change the date one year

#10 Post by ShadowThief » 16 Oct 2014 13:07

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.

Post Reply