Adding computer name and time stamp to copied file

(imported topic written by Jaybird91)

I am copying specific files of systems and onto a share. To identify the files form the different computers I created the following script:

=====

copy “c:\filename.inf” “\share\share_name\filename_{(computer name)}.inf.bak”

delete “c:\filename.inf”

=====

I would like to see how to add the time\date to the file name as well to avoid that the files get overwritten since the action is reapplied if the specific file returns on a specific computer.

Thanks.

(imported comment written by NoahSalzman)

You could replace (computer name) with something like this:

(computer name & “-” & current year as string & “-” & current month as two digits & “-” & current day_of_month as string & “-” & hour_of_day of current time_of_day as string & minute_of_hour of current time_of_day as string)

The output of that Relevance looks like this:

yourcomputername-2010-10-15-1148

(imported comment written by Jaybird91)

Excellent, exactly what I was looking for. Thanks a bunch