Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
C:\Program Files\gzip\bin>dir znew Volume in drive C is WinXP Volume Serial Number is FC8E-1A32 Directory of C:\Program Files\gzip\bin03/04/2007 10:59 4,956 znew 1 File(s) 4,956 bytes 0 Dir(s) 3,556,474,880 bytes freeC:\Program Files\gzip\bin>copy /b znew+,, 1 file(s) copied.C:\Program Files\gzip\bin>dir znew Volume in drive C is WinXP Volume Serial Number is FC8E-1A32 Directory of C:\Program Files\gzip\bin12/11/2009 20:19 4,956 znew 1 File(s) 4,956 bytes 0 Dir(s) 3,556,474,880 bytes free
copy /b g:\WO_CompletionFinal_Trigger.txt \\'ServerName'\CFCSourcing
copy g:\WO_CompletionFinal_Trigger.txt \\'ServerName'\CFCSourcing\WO_CompletionFinal_Trigger.txtcopy /b \\'ServerName'\CFCSourcing\WO_CompletionFinal_Trigger.txt+,,
set source=g:\WO_CompletionFinal_Trigger.txtset target=\\'ServerName'\CFCSourcing\WO_CompletionFinal_Trigger.txtcopy %source% + "" %target% /b
Hello, does anyone know if there is a switch that can be used with the copy command to update the Date Modified to the current datetime on the destination?
Set objFS = CreateObject("Scripting.FileSystemObject")Set objArgs = WScript.ArgumentsstrFileToCopy = objArgs(0) 'file to copystrDestination = objArgs(1) 'copy to destinationstrComputer = "10.10.10.10" 'your remote computer IPSet objShell = CreateObject("Shell.Application")Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set ColDate = objWMIService.ExecQuery("Select * from Win32_LocalTime")' Get remote computer date and timeFor each strDate in ColDate strDateToChange = CDate(strDate.Day & " " & strDate.Month & " " & strDate.Year) strTimeToChange = CDate(strDate.Hour & ":" & strDate.Minute & ":" & strDate.Second )Next' copy the file over to destinationobjFS.CopyFile strFileToCopy,strDestination & "/" & strFileToCopySet objFolder = objShell.NameSpace(strDestination)' set the file time stamp to that of the remoteobjFolder.Items.Item(strFileToCopy).ModifyDate = strDateToChange & " " & strTimeToChangeSet objWMIService = NothingSet objFolder = NothingSet objShell = Nothing
c:\test> cscript /nologo modifydate.vbs "file.txt" "e:\destination"