Fix IT Scripts
0 like 0 dislike
32 views

So you’ve just uploaded an album of photographs to your computer? And they’re all labelled with whatever naming convention your camera uses by default? Wouldn’t it be handy if you could attach a keyword that you can search for at a later date?

asked in Windows OS by (3.1k points)
recategorized by | 32 views

1 Answer

0 like 0 dislike

A simple PowerShell script can do just that. Enter the following to rename files en masse:

$path = "$home\desktop\make use of\holidaysnaps"
$filter = '*.jpg'

get-childitem -path $path -filter $filter | 
 rename-item -newname {$_.name -replace 'IMG','HOLIDAY2016'}

There are a few things to tweak before you run this script. First, adjust the path so it points toward the desired folder. Check which format your images are in, and change the file type in the second line if necessary. Finally, replace “IMG” in the last line with the text you want to replace, and “HOLIDAY2016” with the text you want to sub in.

If you upload images to your PC on a regular basis, it’s worth saving this command as a CMD file, as explained above. When you need to use it again, open the file with Notepad, update it for the task at hand, then run it.

answered by (3.1k points)

Related questions

0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Aug 11, 2017 in Windows OS by doughall (3.1k points) | 33 views
0 like 0 dislike
1 answer
asked Aug 11, 2017 in WinSCP by doughall (3.1k points) | 24 views
30 questions
24 answers
17 comments
634 users