Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Set first image as Folder preview.

18 Jun 2012   #1

Windows 7 Ultimate x64
 
 
Set first image as Folder preview.

Hi,

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.

thanks!

My System SpecsSystem Spec
19 Jun 2012   #2
Arc

Microsoft Community Contributor Award Recipient

Windows 7 Home Premium 64 Bit SP 1
 
 

Possible. if somebody can make a script which will rename all the picture folders first images auto rename to folder.jpg.
My System SpecsSystem Spec
19 Jun 2012   #3

Windows 7 Ultimate x64
 
 

yes, that will be great too
My System SpecsSystem Spec
.


20 Jun 2012   #4
Arc

Microsoft Community Contributor Award Recipient

Windows 7 Home Premium 64 Bit SP 1
 
 

My System SpecsSystem Spec
20 Jun 2012   #5

Windows 7 Ultimate x64
 
 

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.
Code:
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 SpecsSystem Spec
20 Jun 2012   #6

Windows 7 Ultimate x64
 
 

it worked perfectly thanks !
My System SpecsSystem Spec
20 Jun 2012   #7

Windows 7 Ultimate x64
 
 

No problems and good to hear it worked perfectly.
My System SpecsSystem Spec
Reply

 Set first image as Folder preview.





Thread Tools



Similar help and support threads for2: Set first image as Folder preview.
Thread Forum
Solved 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.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33