Thanks! We'll email you
when relevant content is
added and updated.
been reading some of the posts and am blown away by the level of coding and help on the forums.....so I am a little embarrassed by the basic question I have :)
i am admittedly an absolute novice when it comes to vbscript and can
get my head around basics when needed, but as i have run into a problem
i thought i better try reaching out to the experts.
i had a batch script written to convert a filename to yesterdays date
ddmmyyyy where, if mm = 01 would be changed to A and 02 would be B and
so on. Although it worked it wasnt to robust when the month changed so
I wanted to convert it to vbscript.
I managed to get a script together to convert the file to date name and
change it from .csv to .txt but have now run into a small problem of
converting mm from 01 to A.
I know it should be simple but the more i look at the script the more blank my mind goes.
What i need to achieve is converting the month as follows: 01 to A, 02 to B, 03 to C etc.
this is the script so far:
Const sWD = "c:Test"
Const sFName = "c:testtest1.csv"
Const sFName2 = "c:testtest2.csv"
Set oFSO = CreateObject("Scripting.FileSystemObject…
If Not oFSO.FolderExists(sWD) then Error "Cannot locate folder """ & sWD & """"
dYesterday = DateAdd("d", -1, Now())
sYesterday = 1000000 * Day(dYesterday) + 10000 * Month(dYesterday) + Year(dYesterday)
if not oFSO.FileExists(sFName) then Error "Cannot locate file """ & sFName & """"
if not oFSO.FileExists(sFName2) then Error "Cannot locate file """ & sFName2 & """"
oFSO.MoveFile sFName, sYesterday & ".txt"
oFSO.MoveFile sFName2, sYesterday & ".txt"
thanks for your help
January 21, 2010 8:14 PM
January 22, 2010 11:02 PM