WOCSOL - stands for website option cyber solutions, wocsol youtube channel completely concentrated on educational and tutorial videos related to website development, any other code development related topics.
what our main goal is to provide direct solution without wasting time of our viewers, in shortest possible time, we committed to provide solution on base of understanding the issue that how much hard work coders and website developers performs, and it is completely logical that it becomes so frustrating situation when we face errors after so much hard work. thats the reason WOCSOL focus on providing solution in as much as minimum possible time..
please subscribe us, we promise we will not disappoint you. thanks.
WOCSOL
Script for renaming multiple folders names BY WOCSOL
Below is the script you can use as a windows powershell script to rename bulk folders in single command . ..
$path = "your path to the folder in which folders list is to be renamed"
# Validate the path
if (-Not (Test-Path $path)) {
Write-Host "Invalid path! Please check and try again."
exit
}
# Read folder names (original and new) from text files
$oldNames = Get-Content "$path\folder_list.txt"
$newNames = Get-Content "$path\to_rename.txt"
# Ensure both files have the same number of entries
if ($oldNames.Count -ne $newNames.Count) {
Write-Host "Error: The number of old and new folder names does not match!"
exit
}
# Rename folders
for ($i = 0; $i -lt $oldNames.Count; $i++) {
$oldFolder = "$path\$($oldNames[$i])"
$newFolder = "$path\$($newNames[$i])"
if (Test-Path $oldFolder) {
Rename-Item -Path $oldFolder -NewName $newNames[$i] -Force
Write-Host "Renamed: $oldNames[$i] -> $newNames[$i]"
} else {
Write-Host "Folder not found: $oldNames[$i]"
}
}
Write-Host "All folders processed."
7 months ago | [YT] | 2
View 0 replies