C
Chris W
how do I move files from a folder to another folder, and
then the other thing is how do I delete the files after
they have been moved, of course I only want to delete the
files that arte older than 7 days. Here is some script,
but for some reason it is not doing what I need it to do.
It does nothing: I have included the scripts in text
below, didn't know if anyone could possibly point me in
the correct direction:
Move Files:
Const FOF_CREATEPROGRESSDLG = &H0&
TargetFolder = "C:\Move"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(TargetFolder)
objFolder.MoveHere "C:\logfiles", FOF_CREATEPROGRESSDLG
Delete files: (Yes I know I have to add a way to check if
they are older than 7 days, but I was just testing to make
sure it worked before I added that in there, and so far
nothing)
Const DeleteReadOnly = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\logfiles\*.log"), DeleteReadOnly
..
then the other thing is how do I delete the files after
they have been moved, of course I only want to delete the
files that arte older than 7 days. Here is some script,
but for some reason it is not doing what I need it to do.
It does nothing: I have included the scripts in text
below, didn't know if anyone could possibly point me in
the correct direction:
Move Files:
Const FOF_CREATEPROGRESSDLG = &H0&
TargetFolder = "C:\Move"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(TargetFolder)
objFolder.MoveHere "C:\logfiles", FOF_CREATEPROGRESSDLG
Delete files: (Yes I know I have to add a way to check if
they are older than 7 days, but I was just testing to make
sure it worked before I added that in there, and so far
nothing)
Const DeleteReadOnly = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\logfiles\*.log"), DeleteReadOnly
..