|18 Jun 2012||#1|
| || |
Set first image as Folder preview.
So i want to know if i can set first image of each folder as the preview image.
example of what i want:
images in my folder:
View image: images
what it shows:
View image: what it shows
what i want:
View image: what i want
I know i can rename my image as folder.jpg in each folder but i have like 300 folders or even more.
|My System Specs|
|20 Jun 2012||#5|
| || |
As Arc's link lacked the code to rename the files and I had already got the basics working I thought I would still post my script.
This poor script I wrote will rename the first file to folder.jpg in all subfolders in the folder it is placed. It will only do it alphabetically (A-Z) regardless of the file sorting you have set, eg. "A" would be renamed. It also does not check if the file is a .jpg but it does check if the file "folder.jpg" already exist.
Recommend testing on a several subfolders copied to a test folder first. If you want to run it from any location you can put a path and folder name in, just change the bolded text (".\") to your folders path for example, "C:\My Pictures".
There is also a small safety net in the script, it will ask to confirm you want to run it and require you to type the word "Yes" so you should not be able to accidently run it in the wrong location as is it works on all subfolders in the folder it is placed or all subfolders of the path you put in.
You DO NOT want to run this on the wrong folder.
Copy the code to notepad and save as FILENAME.vbs then double click to run it. It will display a message when finished.
strConfirm = InputBox("Are you sure you want to proceed?" & Chr(13) & Chr(13) & "Enter Yes to proceed", _ "Confirmation", "No") If strConfirm = "Yes" Then Set objFSO = CreateObject("Scripting.FileSystemObject") objStartFolder = ".\" ShowSubFolders objFSO.GetFolder(objStartFolder) WScript.echo "Finished" Else WScript.echo "Cancelled" End If Sub ShowSubFolders(Folder) For Each Subfolder in Folder.SubFolders Set objFolder = objFSO.GetFolder(Subfolder.Path) Set colFiles = objFolder.Files If Not objFSO.FileExists(objFolder & "\" & "folder.jpg") Then For Each objFile in colFiles objFSO.MoveFile objFolder & "\" & objFile.Name, objFolder & "\" & "folder.jpg" Exit For Next End If ShowSubFolders Subfolder Next End Sub
|My System Specs|
|Similar help and support threads for2: Set first image as Folder preview.|
|Image preview missing||Music, Pictures & Video|
|explorer folder preview image issue||General Discussion|
|Preview image shortcut Windows 7||Music, Pictures & Video|
|Dragging image preview windows changes at will||Music, Pictures & Video|
|Preview looks warmer than the image actually is||Graphic Cards|
|Image Preview in Win7||Music, Pictures & Video|
|no image preview - help||Music, Pictures & Video|
|Our Sites ||Site Links ||About Us ||Find Us |
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd
All times are GMT -5. The time now is 02:13 AM.