Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Windows SendTo Shortcuts - Copy with Date and Rename with Date

by Melly (Hermit)
on Jan 31, 2010 at 10:27 UTC ( #820564=CUFP: print w/ replies, xml ) Need Help??

A couple of little shortcuts for Windows to put in your "Send To" folder...

This one makes a copy of the selected file, but appends the date and time - e.g. out.txt creates out_20101311022.txt

C:\Perl\bin\wperl.exe -e "use File::Copy;$ARGV[0]=~/(.*\\)([^\\\.]*)(. +*)/;$file=$1.$2.'_'.(join'',(localtime)[5]+1900,(localtime)[4]+1,(spr +intf\"%.2d%.2d%.2d\",(localtime)[3,2,1])).$3;copy($ARGV[0],$file);"

This one is almost identical, but renames rather than copies...

C:\Perl\bin\wperl.exe -e "$ARGV[0]=~/(.*\\)([^\\\.]*)(.*)/;$file=$1.$2 +.'_'.(join'',(localtime)[5]+1900,(localtime)[4]+1,(sprintf\"%.2d%.2d% +.2d\",(localtime)[3,2,1])).$3;rename $ARGV[0],$file;"

And just for completeness, here's to the clipboard as filename (which I've posted before):

C:\Perl\bin\wperl.exe -e "use Win32::Clipboard;$clip = '\"' . $ARGV[0] + . '\"';Win32::Clipboard($clip);"

Hope someone finds these useful...

map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
Tom Melly, pm (at) cursingmaggot (stop) co (stop) uk

Comment on Windows SendTo Shortcuts - Copy with Date and Rename with Date
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://820564]
Approved by planetscape
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2015-11-25 18:00 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (684 votes), past polls