Question: I have a folder which has several files with .txt extension. I need to delete them but before that I need to take backup of it. 

For example, assume I have a folder with the following contents: 

```
name1.txt  
name2.txt   
name3.txt   
name4.txt   

```

After I delete, the contents of my folder should be: 

```
name1.txt.bkup  
name2.txt.bkup  
name3.txt.bkup  
name4.txt.bkup  

```

How can this be done?

Answer: 
Just rename .txt-files to .txt.bkup, i.e.: 

```
rename *.txt *.txt.bkup

```

---

If you *insist* on creating backups before deleting (for example, a configurable batch file, where creating backups may be switched off), then you can copy files before deleting: 

```
copy *.txt *.txt.bkup
del *.txt

```
try this:

```
copy *.txt *.txt.bkup
del *.txt

```