Option 1: Using Windows PowerShell
Open the window menu. Type: "PowerShell" and open a Windows PowerShell command prompt.
Open the folder with the necessary files: for example. cd "C: \ house chores" Note: the address must contain quotation marks "" if there are spaces.
You can use 'dir' to view all the files in a folder. Using '|' there will be pipelined output "dir" for the next command.
Notes: 'dir' is an alias of 'Get-ChildItem'. See: wiki: cmdlets . Additional functionality can be provided. for example, 'dir -recurse' displays all files, folders, and subfolders.
What if I need only a series of files?
Instead of 'dir \' I can use:
dir | where-object -filterscript {($_.Name -ge 'DSC_20') -and ($_.Name -le 'DSC_31')} |
For batch renaming with a directory name as a prefix:
dir | Rename-Item -NewName {$_.Directory.Name + " - " + $_.Name}
Option 2. Using the command line
In the folder, press shift + right-click: select "open command window here"
for %a in (*.*) do ren "%a" "prefix - %a"
If there are many files, it might be nice to add the "@echo off" command before this and the "echo on" command at the end.
ofer.sheffer Jan 02 2018-11-14T00: 00Z
source share