Computing.Net > Forums > Programming > what to do to make it work on dates

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

what to do to make it work on dates

Reply to Message Icon

Name: alwaysk2
Date: August 26, 2008 at 20:13:30 Pacific
OS: Windows 2003 Ent. Server
CPU/Ram: 8GHZ/ 16GB
Product: IBM
Comment:

hi i have made a batch file which has two different date functions one is like 08272008 and another is 082708 :

here is the whole batch file :
=========================================
set Pdate=%date:~4,2%%date:~7,2%%date:~10,4%%1
for /f "tokens=2,3,4 delims=/ " %%i in ('date /t') do (
set my_month=%%i
set /A my_day=%%j-1
set my_year=%%k )
set my_year=%my_year:~2,2%
set X=%my_month%%my_day%%my_year%
set copyme=xcopy /s /c /d /e /h /i /r /y /V

echo.
echo.
echo.
SET TQS="D:\ONCO\logs\batches\%x%"
::MAPPING DESTINATION PATH TO Z DRIVE WITH CONNECTED ON NEXT LOGON SWITCH
net use Z: \\srv1\d$\files fruity/USER:user.com\fruit /PERSISTENT:YES

:: ASKING USER TO ENTER PREVIOUS DAY'S DATE
set /P d= PLEASE ENTER DATE : -

set sor="Z:\Source\TQSA\%d%"

IF /I %d% lss %pdate% GOTO DO
) ELSE
goto :ERROR
)

:DO
SET TQS="D:\ONCO\logs\batches\%x%"
cls
"C:\Program Files\7-Zip\7z.exe" x "%TQS%\TQS%X%HCF.zip" -o"%TQS%" -r

d:
PAUSE>NUL
cls
%COPYME% * "%sor%"
ECHO.
ECHO.

==========================================


This batch file extracts from folder like 082708 and copies it to another destination on 08272008 folder. but the main limitation of this file is like i can't run this batch file on 08272008 date i must have to run it on 08282008 as the batch file searches the folder 082708 only if the current system date is 08282008.

what do i need to add or edit to make it run on 08272008 and also on 08282008 together?

Thanx in advance

K2™
System/Network Engineer



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Batch that grabs a random... math in batch



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: what to do to make it work on dates

any good programs to make a game on www.computing.net/answers/programming/any-good-programs-to-make-a-game-on/9640.html

ping executable www.computing.net/answers/programming/ping-executable/12513.html

gcc instolation problem www.computing.net/answers/programming/gcc-instolation-problem/13146.html