Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch File set a variable of yesterday's DAY in DDD format as well as

Status
Not open for further replies.

croag

MIS
Nov 8, 2001
49
0
0
US
Greetings,

I have searched, taken numerous stabs and pulled out my hair in attempting to set a variable for yesterday's day in DDD format e.g. - MON, TUE, etc. I also need the same for the current day. The situation is that I have production box performing a nightly oracle export (each named MON.dmp, TUE.bat, etc) and the plan, which is easy enough to visualize, is to copy each day's finished export file onto a test server and import the data into a freshly created database named for the current day. Hence the need for the current day in DDD format. I also need the previous day's format in DDD format because I'll need to first stop the previous day's database and associated oracle services before the new day's database can be created. Can this be done wth either internal dos commads and/or wsh from a batch file? Btw, this is on windows 2000 server.

Many, many, Many Many thanks!

croag
 
croag,

what about vbs?
quick and dirty:
Code:
dim cur_day
dim back_day

if weekday(today) = 1 then cur_day = "SAT"
if weekday(today) = 2 then cur_day = "SUN"
if weekday(today) = 3 then cur_day = "MON"
if weekday(today) = 4 then cur_day = "TUE"
if weekday(today) = 5 then cur_day = "WED"
if weekday(today) = 6 then cur_day = "THU"
if weekday(today) = 7 then cur_day = "FRI"
if weekday(today - 1) = 0 then back_day = "FRI"
if weekday(today - 1) = 1 then back_day = "SAT"
if weekday(today - 1) = 2 then back_day = "SUN"
if weekday(today - 1) = 3 then back_day = "MON"
if weekday(today - 1) = 4 then back_day = "TUE"
if weekday(today - 1) = 5 then back_day = "WED"
if weekday(today - 1) = 6 then back_day = "THU"

msgbox cur_day & " " & back_day
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top