February 21, 2006 at 8:21 am
how can we move files
February 21, 2006 at 8:37 am
Copyfile method is for moving files but keeping their original name.
Look into Copy method. See link:
February 21, 2006 at 8:53 am
thanks for the help.
But this does the same thing I do. I need to append the system date to the file after I copy or move it.
February 21, 2006 at 9:21 am
I think the problem is that you are trying to create an extension - .dash26/01/06.
Slashes are not allowed in filenames. Try formatting the date to remove slashes, dots etc...
February 22, 2006 at 4:40 am
sDestinationFile = "C:\activant\bkup\test.dash" & "-" & Year & Right( "0" & Month(Now), 2) & Right( "0" & Day(Now), 2)
This would give you the following result
test.dash-20060222
-Mike Gercevich
March 7, 2006 at 4:48 pm
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * from Cim_Datafile where Name = " _
& "'f:\\Backups\\NombreArchivoARenombrar.bkf'")
dim nombre
nombre = datepart("yyyy",now()) & datepart("m",now()) & datepart("d",now())
strDate = cstr(date())
For Each objFile in colFiles
errResult = objFile.Rename("f:\\Backups\\" & nombre & ".bkf")
Next
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply