General discussion


scripting question

By Jamie Schnabel ·
I have an applicationt that creates a folder each day. The name of the folder is named with the current day (20060823). so each day it creates a folder with the day and puts a file in that folder. I want to create a script that looks for the folder with the date and moves the file in the folder to another network location. I need some help in the script on how to change the path its looking for.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Jamie Schnabel In reply to scripting question

Point value changed by question poster.

Collapse -

by lowlands In reply to scripting question

You'll have to give me a little more info.
Will your script need to run without any user intervention? Will it run every day and then look for yesterday's folder, or two days ago, or all folders?

Answer in the thread or pm me

Collapse -

by lowlands In reply to

OK, so what you need is a way to determine the data, and then change the folder accordingly.
I should have asked what scripting language you (want to) use. But below is some vbscript

'create a date string that can be appended to the file name
wscript.echo date
strDate = date
dateArray = Split(strdate, "/", -1, 1)
if len(dateArray(0)) = "1" Then
strNewDateString = dateArray(2) & dateArray(1) & "0" & dateArray(0)
strNewDateString = dateArray(2) & dateArray(1) & dateArray(0)
end if

StrFolderName = "D:\" & strNewDateString

You will have to play around a little with the folder names etc, but this would add today's date to your folder.

Then you can add your copy routine.

Collapse -

by Jamie Schnabel In reply to scripting question

no user intervention. It will run at 11:30pm and look for that days folder date only.

Related Discussions

Related Forums