I need a batch picture renamer software

Status
Not open for further replies.

EricB

Chillin Techie
Messages
11,861
Location
USA
I need a batch picture renamer software or a media player that will automatically recognize Picture in a music folder as album art.

I have a alpine media player for my car. it plugs up to my ipod and hdd. it recognized album art. I have over 200 gigs of music. most of it is old school and the pics are in the folder. I want to see album art for all of my songs. itunes and wmp doesn't recognize most of the old school album art as they recognize mostly new music. Anapod explorer will recognize the pictures, but only if you name the picture in the folder Cover.jpg.

that's over 600 pictures to rename in my music folders. anybody know of of some software to help make it easy for me?
 
Copy this into a new text file.Change the Path between the ***'s to where your music is stored. This must be a folder above any folders with the jpg's in them. It will not change any jgp files in the c:\test folder.

Save the text file, then change the extension to .vbs.
Then just run it and watch the JPG files change away :)

FYI, this will change all JGP files to Cover.jpg, so watch out.


Code:
'********************************** SET THIS TO THE PATH TO YOUR FOLDERS *********************
Root = "c:\test"
'***************************** All folders should be sub folders under this one **************




strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}\\" & strComputer & "\root\cimv2")


strFolderRoot = Replace(Root, "\", "\\")
wscript.echo strfolderroot

Set colFolders = objWMIService.ExecQuery _
 ("Select * from Win32_Directory where Name Like '" & strFolderRoot & "%'")
	
count = 0
For Each objFolder in colFolders
  strTMP = Replace(Mid(objFolder.Name,4,Len(objFolder.Name)),"\","\\") 
  strQuery = "SELECT * FROM CIM_DataFile WHERE Drive = 'c:' AND Path = '\\" & strTMP & "\\' AND Extension = 'jpg'"

  Set colFiles = objWMIService.ExecQuery(strQuery)

  For Each objFile in colFiles
	Location = instrrev(objFile.name, "\")
	If Not Right(objFile.Name, Len(objFile.name) - Location) = "cover.jpg" Then
		Path = Left(objFile.Name, Location)
		objFile.Rename(Path & "Cover.jpg")
		count = count + 1
	End If
  next
next
 
Copy this into a new text file.Change the Path between the ***'s to where your music is stored. This must be a folder above any folders with the jpg's in them. It will not change any jgp files in the c:\test folder.

Save the text file, then change the extension to .vbs.
Then just run it and watch the JPG files change away :)

FYI, this will change all JGP files to Cover.jpg, so watch out.


Code:
'********************************** SET THIS TO THE PATH TO YOUR FOLDERS *********************
Root = "c:\test"
'***************************** All folders should be sub folders under this one **************




strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}\\" & strComputer & "\root\cimv2")


strFolderRoot = Replace(Root, "\", "\\")
wscript.echo strfolderroot

Set colFolders = objWMIService.ExecQuery _
 ("Select * from Win32_Directory where Name Like '" & strFolderRoot & "%'")
	
count = 0
For Each objFolder in colFolders
  strTMP = Replace(Mid(objFolder.Name,4,Len(objFolder.Name)),"\","\\") 
  strQuery = "SELECT * FROM CIM_DataFile WHERE Drive = 'c:' AND Path = '\\" & strTMP & "\\' AND Extension = 'jpg'"

  Set colFiles = objWMIService.ExecQuery(strQuery)

  For Each objFile in colFiles
	Location = instrrev(objFile.name, "\")
	If Not Right(objFile.Name, Len(objFile.name) - Location) = "cover.jpg" Then
		Path = Left(objFile.Name, Location)
		objFile.Rename(Path & "Cover.jpg")
		count = count + 1
	End If
  next
next


it will just change all the pictures in my music folder but not my pictures folder right?

L:\My Music is my music folder. can you put it in the right place so I won't mess anything up

thanks for your help
 
Here you go for just your music folder

Code:
'********************************** SET THIS TO THE PATH TO YOUR FOLDERS *********************
Root = "L:\My Music"
'***************************** All folders should be sub folders under this one **************




strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}\\" & strComputer & "\root\cimv2")


strFolderRoot = Replace(Root, "\", "\\")
'wscript.echo strfolderroot

Set colFolders = objWMIService.ExecQuery _
 ("Select * from Win32_Directory where Name Like '" & strFolderRoot & "%'")
	
count = 0
For Each objFolder in colFolders
  strTMP = Replace(Mid(objFolder.Name,4,Len(objFolder.Name)),"\","\\") 
  strQuery = "SELECT * FROM CIM_DataFile WHERE Drive = 'L:' AND Path = '\\" & strTMP & "\\' AND Extension = 'jpg'"

  Set colFiles = objWMIService.ExecQuery(strQuery)

  For Each objFile in colFiles
	Location = instrrev(objFile.name, "\")
	If Not Right(objFile.Name, Len(objFile.name) - Location) = "cover.jpg" Then
		Path = Left(objFile.Name, Location)
		objFile.Rename(Path & "Cover.jpg")
		count = count + 1
	End If
  next
next
 
it's not working, I get this error

Image1-2.jpg
 
Oh, you're on vista.... hmmmm.
Not sure if the WMI classes are the same. I don't have a windows box at home. I'll take a look on Monday.
 
Status
Not open for further replies.
Back
Top Bottom