Results 1 to 3 of 3

Thread: How to rename files based on other files with VBScript, help

  1. #1
    Join Date
    Sep 2012
    Posts
    20

    How to rename files based on other files with VBScript, help

    I have a large collection of pictures and videos that I have shot using my DSLR camera. The images are in names as named by the camera. The camera names the images with the date, month, year and series by default. So I have such a large collection of images that number goes up to 1000. Similarly there are many videos, maybe 100 to 150 in number. The format for all these images is same, that is, jpg. Similarly, for all videos format is wmv. I would like to rename all the pictures in simpler way, for example, pic_01.jpg and same for videos. At present the names are like 11092001wtc.jpg and so on. Remembering this large numbers is problem. Can someone tell me how to do it using software created using Visual Basic 2012?

  2. #2
    Join Date
    Dec 2007
    Posts
    1,736

    re: How to rename files based on other files with VBScript, help

    The first thing that you will have to do is to make a code that will help the software recognize the format of the file, which is jpg, wmv. You can program it to only accept jpg for images and wmv for videos. If not done, it might go renaming everything that comes in its way in similar fashion, even the desktop.ini file in it. So to not mess up the things more, this should be the first priority. Once you are done with it, make a code which will start renaming the files in a specific sequence. I suggest that since this is your first attempt, you should stick to static names for the files and avoid user based naming.

  3. #3
    Join Date
    Feb 2009
    Posts
    673

    re: How to rename files based on other files with VBScript, help

    I have the basic syntax for renaming the file using the software developed in Visual Basic 2012. Here is the syntax,
    @echo off
    setlocal enabledelayedexpansion
    set fcount=0
    FOR /F "TOKENS=* delims=" %%G in ('dir /a-d /OD /TC /B *.wmv *.jpg') DO (
    set /a fcount+=1
    IF "!fcount!"=="1" set img_01=%%G
    IF "!fcount!"=="2" (
    set videowmv_01=%%~nG
    set wmvname1=! videowmv_01:~0,-8!
    set wmvname2=! videowmv_02:~-8,8!
    )
    IF "!fcount!"=="3" (
    set fcount=0
    set jpg2name=%%G
    echo rename "! img_01!" "! videowmv_01!M1!- videowmv_02!.jpg"
    echo rename "! img_02!" "! videowmv_01!M3!- videowmv_02!.jpg"
    )
    )
    pause

Similar Threads

  1. how to rename pdf files on acer 500
    By tina1252 in forum Windows Software
    Replies: 1
    Last Post: 03-02-2012, 12:22 AM
  2. Rename Multiple Files
    By ismart in forum Tips & Tweaks
    Replies: 1
    Last Post: 11-05-2011, 12:43 AM
  3. Managing Files with VBScript
    By Monty1 in forum Software Development
    Replies: 2
    Last Post: 14-12-2010, 12:36 AM
  4. How to rename files on mac
    By Samara in forum Operating Systems
    Replies: 7
    Last Post: 28-05-2010, 01:51 PM
  5. Rename MP3 Files With Its ID3 Tags
    By Atilla in forum Windows Software
    Replies: 3
    Last Post: 29-04-2009, 02:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,243,033.80605 seconds with 17 queries