Lowyat.NET Forums

Welcome Guest ( Log In | Register )

LYN wins Intel-Lenovo-Tangs Blogathon challenge. Thank you everybody!
 
RSS feedBump TopicReply to this topicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> Regarding DOS batch file, replace system date by a file content

binqo89
post Nov 4 2009, 03:04 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #1


Getting Started
**

Group: Junior Member
Posts: 80
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Aug 2008




my code as below

@echo off

if %DATE:~10,4%%DATE:~4,2%%DATE:~7,2% LSS 20091101 goto else
echo %date% > C:\Date.LOG
exit

goto endif

:else
echo "error! Date is incorrect!"
echo current date : %date%

@pause

:endif

from the code above, a LOG file with date inside it will be created.
now what i want to do is retrieve the date inside the log to replace my computer's date
(either the date inside the log file or the log file modified date)

anyone can help on this ?
thanks .
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
eek-1
post Nov 4 2009, 04:56 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #2


Casual
***

Group: Junior Member
Posts: 451
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003
From: Bukit Mahkota






DATE <C:\DATE.LOG
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicReply to this topicTopic OptionsStart new topic
 



----debug section please ignore----
Lo-Fi Version Time is now: 23rd November 2009 - 06:12 PM
All Rights Reserved 2003-2009 Vijandren Ramadass (~living on a prayer~)