Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 /Vecho.
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%" -rd:
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

![]() |
Batch that grabs a random...
|
math in batch
|

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