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.
Incremental Foldername BatchJob
Name: UraX Date: May 16, 2009 at 09:59:04 Pacific OS: Win XP Subcategory: Batch
Comment:
Howdy all!
I need your urgent help! I am looking for a batchScript who would be placed in scheduled tasks and each week it would create a new folder, ex. "2009_weekXX" (where xx is just an incremental number based on the current week, no real need for a calendarcheck, just the ability to set the "StartWeekNumber". Does anyone feel up tor the task? :D
Name: Valerie (by Garibaldi) Date: May 16, 2009 at 13:39:34 Pacific
Reply:
The following will generate what you want. It's based on the How-To posting Manipulate Date by Wahine here http://www.computing.net/howtos/sho... It's not strictly batch scripting but then manipulating date info in batch scripting is notoriously difficult.
The script is date format insensitive.
:: Code begins...
@echo off
cls
set newfile=%temp%\date.vbs
echo otherdate = (Date())>%newfile%
echo yy = datePart("yyyy", otherdate)>>%newfile%
echo wy = datepart("ww" , otherdate)>>%newfile%
echo wscript.echo yy^&" "^&wy>>%newfile%
FOR /F "tokens=1-2" %%A in ('cscript //nologo %newfile%') do (
set year=%%A
set woy=%%B
)
del %newfile%
if %woy% lss 10 set woy=0%woy%
echo Output = %year%-Week%woy%
:: if not exist %year%-week%woy%\ md %year%-week%woy%\
:: Code ends..
Summary: C++ supports data abstraction more so than C does. There are also a lot more features that C++ offers that does not have. C if I remember correctly gives more direct access to the computer's hardware ...
Summary: I have lot of files with the following naming format: 1.txt, 2.txt, 3.txt etc. I would like to increment the numeric portion of the filename by a factor e.g. 1000. Can someone please help me with the...
Summary: I am currently pulling a filename xxxyyy.jpg from a remote site over tcp/ip that is updated every 4 -5 hours with new data but the same name. I can save it to a folder of my choosing with task sched...