dos trick 2
create dynamic folder base on current date, in dos, note in dos
suatu hari temen gwa nanya ke gwa… gimana caranya create folder berdasarkan tgl hari itu secara dynamic, mulanya gwa pikir wahhh piece o’ cake untill he said, in dos command, what the fck, slintas terpikir untuk pake j script or wsh script, tapi karena tertantang, jadi aja gwa jabanin, malam itu tanpa koneksi internet dan hanya bermodal help window terciptalah dos command antik berikut inih
C:\>for /F “tokens=1,2,3* delims=/” %i in (`date /t`) do @echo %i %j %k
The system cannot find the file `date.
C:\>for /F “tokens=1,2,3* delims=/” %i in (‘date /t’) do @echo %i %j %k
16 05 2007
C:\>for /F “tokens=1,2,3* delims=/” %i in (‘date /t’) do @mkdir %i\%j\%k
C:\>for /F “tokens=1,2,3* delims=/” %i in (‘date /t’) do @mkdir %i%j%k
C:\>for /F “tokens=1,2,3* delims=/” %i in (‘date /t’) do @mkdir %j%i%k


gileee.. hebat banget lo men.. inilah tipikal anak IT sejati, sekalinya gak ketemu jalan keluar, di tongkrongin ampe selesai.. wuoee.. lo kesini deh, bantuin gw.. bisa-bisa g1 berevolusi huehehe..
jusran
June 14, 2007
and now…still in dos command of course
i want to copy a file to those folder
using batch file…
so every day or week perhaps i found a dated folder name with a file in it….
it really usefull for auto backup….
coz usualy my everyday backup event overwrite old back up file instead of copying it on another dated folder…….
H
July 4, 2009
@echo off
MD Coba
xcopy d:\databasenya F:\coba /s
for /F “tokens=2-4 delims=/ ” %%i in (‘date /t’) do rename coba HNRBackUP_%%k_%%i_%%j
letakan di batch file anda… atur jadwal and done
hnr
August 12, 2009
thx h :p can’t wait to test it :p
j
August 12, 2009