Over a million developers have joined DZone.

CMD Text File Rotation 60 Generations

·
// Simple CMD text file rotation 60 generations

@echo off

if not exist %1.txt goto :EOF
if exist %1_62.txt del %1_62.txt

if exist %1_60.txt ren %1_60.txt %1_61.txt
if exist %1_59.txt ren %1_59.txt %1_60.txt
if exist %1_58.txt ren %1_58.txt %1_59.txt
if exist %1_57.txt ren %1_57.txt %1_58.txt
if exist %1_56.txt ren %1_56.txt %1_57.txt
if exist %1_55.txt ren %1_55.txt %1_56.txt
if exist %1_54.txt ren %1_54.txt %1_55.txt
if exist %1_53.txt ren %1_53.txt %1_54.txt
if exist %1_52.txt ren %1_52.txt %1_53.txt
if exist %1_51.txt ren %1_51.txt %1_52.txt
if exist %1_50.txt ren %1_50.txt %1_51.txt
if exist %1_49.txt ren %1_49.txt %1_50.txt
if exist %1_48.txt ren %1_48.txt %1_49.txt
if exist %1_47.txt ren %1_47.txt %1_48.txt
if exist %1_46.txt ren %1_46.txt %1_47.txt
if exist %1_45.txt ren %1_45.txt %1_46.txt
if exist %1_44.txt ren %1_44.txt %1_45.txt
if exist %1_43.txt ren %1_43.txt %1_44.txt
if exist %1_42.txt ren %1_42.txt %1_43.txt
if exist %1_41.txt ren %1_41.txt %1_42.txt
if exist %1_40.txt ren %1_40.txt %1_41.txt
if exist %1_39.txt ren %1_39.txt %1_40.txt
if exist %1_38.txt ren %1_38.txt %1_39.txt
if exist %1_37.txt ren %1_37.txt %1_38.txt
if exist %1_36.txt ren %1_36.txt %1_37.txt
if exist %1_35.txt ren %1_35.txt %1_36.txt
if exist %1_34.txt ren %1_34.txt %1_35.txt
if exist %1_33.txt ren %1_33.txt %1_34.txt
if exist %1_32.txt ren %1_32.txt %1_33.txt
if exist %1_31.txt ren %1_31.txt %1_32.txt
if exist %1_30.txt ren %1_30.txt %1_31.txt
if exist %1_29.txt ren %1_29.txt %1_30.txt
if exist %1_28.txt ren %1_28.txt %1_29.txt
if exist %1_27.txt ren %1_27.txt %1_28.txt
if exist %1_26.txt ren %1_26.txt %1_27.txt
if exist %1_25.txt ren %1_25.txt %1_26.txt
if exist %1_24.txt ren %1_24.txt %1_25.txt
if exist %1_23.txt ren %1_23.txt %1_24.txt
if exist %1_22.txt ren %1_22.txt %1_23.txt
if exist %1_21.txt ren %1_21.txt %1_22.txt
if exist %1_20.txt ren %1_20.txt %1_21.txt
if exist %1_19.txt ren %1_19.txt %1_20.txt
if exist %1_18.txt ren %1_18.txt %1_19.txt
if exist %1_17.txt ren %1_17.txt %1_18.txt
if exist %1_16.txt ren %1_16.txt %1_17.txt
if exist %1_15.txt ren %1_15.txt %1_16.txt
if exist %1_14.txt ren %1_14.txt %1_15.txt
if exist %1_13.txt ren %1_13.txt %1_14.txt
if exist %1_12.txt ren %1_12.txt %1_13.txt
if exist %1_11.txt ren %1_11.txt %1_12.txt
if exist %1_10.txt ren %1_10.txt %1_11.txt
if exist %1_09.txt ren %1_09.txt %1_10.txt
if exist %1_08.txt ren %1_08.txt %1_09.txt
if exist %1_07.txt ren %1_07.txt %1_08.txt
if exist %1_06.txt ren %1_06.txt %1_07.txt
if exist %1_05.txt ren %1_05.txt %1_06.txt
if exist %1_04.txt ren %1_04.txt %1_05.txt
if exist %1_03.txt ren %1_03.txt %1_04.txt
if exist %1_02.txt ren %1_02.txt %1_03.txt
if exist %1_01.txt ren %1_01.txt %1_02.txt

copy %1.txt %1_01.txt

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}