# Use This Script To Rename Multiple Files At Once In Windows | Know-How!

**URL:** <https://onehack.st/t/use-this-script-to-rename-multiple-files-at-once-in-windows-know-how/61811>\
**Category:** Tutorials & Methods\
**Tags:** tips-tricks, file-management\
**Created:** [November 6, 2019, 2:19pm UTC](https://onehack.st/t/use-this-script-to-rename-multiple-files-at-once-in-windows-know-how/61811 "2019-11-06T14:19:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aina](https://onehack.st/user_avatar/onehack.st/aina/32/167469_2.png) [@Aina](https://onehack.st/u/Aina)\
**Post date:** [November 6, 2019, 2:19pm UTC](https://onehack.st/t/use-this-script-to-rename-multiple-files-at-once-in-windows-know-how/61811/1 "2019-11-06T14:19:10Z")

</div>

**You’ll save yourself boatloads of time**

Do you need to rename several files at once in Windows? It can be quite the task to do it manually, but Windows supports scripts that you can run to automate the renaming process, saving you loads of time.

As an example, consider a case like in the example image above where you have a folder of hundreds of images each named **Copy of** and then a word or two, like **Copy of Black Tea.jpg**.

Instead of manually renaming each file to delete “Copy of” or to change those words to something else, you could run a script to do all the renaming for you.

![1](https://onehack.st/uploads/default/original/3X/e/6/e6384315f785bec234ed1fa2033070d3054f0483.gif)

Software programs and cameras often append a specific set of characters to exported files, so this script comes in handy in those circumstances.

## **How to Make the Renaming Script**

A script is essentially a carefully crafted set of commands to tell the computer exactly what to do. Here’s the “find and replace” script we’re dealing with:

```auto
Set objFso = CreateObject(“Scripting.FileSystemObject”)

Set Folder = objFSO.GetFolder(“ENTER\PATH\HERE”)

For Each File In Folder.Files

sNewFile = File.Name

sNewFile = Replace(sNewFile,”ORIGINAL”,”REPLACEMENT”)

if (sNewFile<>File.Name) then

File.Move(File. *ParentFolder* +”\”+sNewFile)

end if

Next
```

To use this script requires a text editor. Notepad, built-in to Windows, will do just fine.

**Step 1** : Open Notepad. You can do this by searching for **Notepad** in the Start menu or by executing the **notepad** command in the Run dialog box ( **WIN+R** ).

 ![image](https://onehack.st/uploads/default/original/3X/c/2/c22da2416f9cb5f3ee5d48948346a68dff5b11ef.png)

**Step 2** : Copy the script exactly as it’s shown above, and paste it into Notepad.

 ![image](https://onehack.st/uploads/default/original/3X/9/f/9f7354405452a7b69026b72505264190ff4b46ed.png)

**Step 3** : Edit the file rename script to make it apply to your unique situation.

To do that, you need to change the text called **ENTER\PATH\HERE** to the exact folder where your soon-to-be-renamed files are located.

For example, maybe you want to rename a group of files in a folder on your desktop, in which case your folder path might look like this: \*_C:\Users\Matt\Desktop\Converted MP3s\*_ .

To make the script always apply to the folder it’s currently located in, just change the path to \*_.\*_ . That is, a period and then a backslash, without a space. Using the script this way lets you drop it into any folder and have it automatically apply to only that folder.

Also, change **ORIGINAL** to the characters you want to replace, and delete **REPLACEMENT** so that you can enter the text that should replace the original characters. In other words, you can read this line of the script as “ _replace THIS with THIS._ ”

_Note: Make sure you keep the quotes in every instance you see them. They need to remain in the folder path and the replace section._

 ![image](https://onehack.st/uploads/default/original/3X/7/e/7e04a72d7f73bdada1f47aa1cad848ef77ae3951.png)

**Step 4** : Go to **File** \> **Save As** and name the file anything you like, but be sure to change the “Save as type” option to **All Files (\*)** and append **.vbs** to the end of the file name.

 ![image](https://onehack.st/uploads/default/original/3X/8/a/8a7c11ec2ad1581200f7ad28867160e66c2658c9.png)

**Step 5** : You can now close out of Notepad and execute the VBS file to apply the script.

 ![image](https://onehack.st/uploads/default/original/3X/9/4/94d3cde901487219a5442c40941c2e289c6778a3.jpeg)

That’s it! To edit the VBS file to change the location of the files to rename, or to adjust what to replace in the files, just right-click the VBS file like you see above, but instead of opening it, choose **Edit**.

## **How to Bulk Rename Files in Windows 10**

If you’re using Windows 10, there’s a built-in renaming feature that’s easy to use and might be exactly what you’re after. This method is unique compared to the script above because it works even if the files have completely different filenames.

In other words, these two methods have completely different use cases. Let’s say you have 100 files that each have the word **house** in them along with other random characters. You want to keep all the characters untouched but make the word house into **home**. The script is great for that.

 ![image](https://onehack.st/uploads/default/original/3X/c/b/cb474b64dc8ddf3fccf3a1fa6fbc8f8fd16c04dc.jpeg)

However, if the 100 files are all named random characters and you want them to be really similar like **housepics** , you can use the Windows 10 renaming function to rename the first to **housepics (1)** , the second to **housepics (2)** , the third to **housepics (3)** , and so on.

Here’s how to do this in Windows 10:

**Step 1** : Highlight the files you want to rename.

**Step 2** : Press the **F2** key or right-click one of the selected files and choose **Rename**.

**Step 3** : Type the filename you want to use and then press **Enter**.

Instantly, every selected file will use the exact same filename. If each file is using a different file extension, they’ll all be named identically, but if they have the same file extension, a number will be appended to the end since two or more files can’t use the same filename in the same folder. _(Source: helpdeskgeek)_

## ENJOY & HAPPY LEARNING! 👍

---

<div class="post-metadata">

**Author:** ![Dracaryu](https://onehack.st/user_avatar/onehack.st/dracaryu/32/18984_2.png) [@Dracaryu](https://onehack.st/u/Dracaryu)\
**Post date:** [November 6, 2019, 5:09pm UTC](https://onehack.st/t/use-this-script-to-rename-multiple-files-at-once-in-windows-know-how/61811/2 "2019-11-06T17:09:25Z")

</div>

Nice share SaM.  
If anyone prefer a visual version there is the software  
Bulk Rename Utility which is wonderful.

---

<div class="post-metadata">

**Author:** ![bdsmack](https://onehack.st/letter_avatar_proxy/v4/letter/b/ee7513/32.png) [@bdsmack](https://onehack.st/u/bdsmack)\
**Post date:** [November 6, 2019, 5:22pm UTC](https://onehack.st/t/use-this-script-to-rename-multiple-files-at-once-in-windows-know-how/61811/3 "2019-11-06T17:22:32Z")

</div>

@Aina this is absolutely unique thought that is memorable 😄
