# Script CheckYesterday.txt var str file, date # Get yesterday's date. set $date = addtime(diff("-1000000")) # Get only the mmdd part. chex "8[" $date > null ; chex "4]" $date > null # The file name will be "C:/somefolder/TRB0"+$date+".zip" set $file = "C:/somefolder/TRB0"+$date+".zip" # Check if file exists. af $file if ($fexists) echo "File " $file " exists." else echo "File " $file " does not exist." endif
script "C:/Scripts/CheckYesterday.txt"
# Script AppendTimestamp.txt var str folder, list, file, extn, name lf -n "*" $folder ($ftype=="f") > $list while ($list <> "") do lex "1" $list > $file ; stex -p "^/^l[" $file > $name ; stex "[^.^l" $name > $extn system rename ("\""+$file+"\"") ("\""+$name+"_"+gettime()+$extn+"\"") done
script "C:/Scripts/AppendTimestamp.txt" folder("C:/somefolder")
how do I write a script to find system date in the following format YYYYMMDD and use it to create folder using the same date.
REM - Create Date and Time strings
set Today=%date:~10,4%%date:~4,2%%date:~7,2%
set Now=%time:~0,2%%time:~3,2%%time:~6,2%
set DOW=%date:~0,3%
say log.txt
and create one bat file ,open in edit mode and write the below line of code
echo the current date and tine is %time%%date%>>log.txt
I need program or procedure to extract the Gregorian date and the equevelent Hijri date from windows to the text file for 10 years .
waiting for your response .