Discussion Locked

scripting question

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
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.

4 replies

by lowlands

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

by lowlands

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)
else
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.

This discussion is closed to new replies.