Results 1 to 7 of 7

Thread: VB6 - ADD and REMOVE EXTENSIONs TO ALL FILES In A FOLDER

  1. #1

    Thread Starter
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    VB6 - ADD and REMOVE EXTENSIONs TO ALL FILES In A FOLDER

    Hey Friends !!!!!!!!!!!!!!!!!

    Dis is the first time I have posted to the Codebank,, AND my tiny contribution dis time is to add or remove Extensions (Additional) to ALL the files in a Folder. I have also attached a file to remove any Extension added by this tool or otherwise also. I didn't find it necessary to comment in each and every step,so there are almost NO comments.


    Please feel free to comment and suggestions ARE welcome!!!!!!!!!!!


    thanx
    wiz....
    Attached Files Attached Files
    Last edited by wiz....; Dec 30th, 2008 at 03:19 AM. Reason: Forgot to add VB6 in the subject!
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VB6 - ADD and REMOVE EXTENSIONs TO ALL FILES In A FOLDER

    Why would you want to do this?

  3. #3

    Thread Starter
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    Re: VB6 - ADD and REMOVE EXTENSIONs TO ALL FILES In A FOLDER

    I would want to do this ...for eg. I have 100 jpg images in a folder and i want to convert all of them to .gif ....... I use this to do so.........(in this case it allows us to convert jpg directly to gif)............and secondly I am trying to develop a program which hides the files in af folder...so I kind of use this cde in that....so I thought it may be useful.
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  4. #4
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: VB6 - ADD and REMOVE EXTENSIONs TO ALL FILES In A FOLDER

    Quote Originally Posted by wiz....
    I would want to do this ...for eg. I have 100 jpg images in a folder and i want to convert all of them to .gif ....... I use this to do so.........(in this case it allows us to convert jpg directly to gif)............and secondly I am trying to develop a program which hides the files in af folder...so I kind of use this cde in that....so I thought it may be useful.
    But changing a file names extension from .JPG to .GIF doesn't actually convert it into a different format, it's still a JPEG no matter what you call it!

    And if you are converting them you would first create the GIF file before you start messing with the original files.

  5. #5

    Thread Starter
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    Re: VB6 - ADD and REMOVE EXTENSIONs TO ALL FILES In A FOLDER

    hey Edgemeal!!!!! i've tried it many times and it works....itsn ot necessary that you first have to create the GIF file. Another eg. My mobile doesn't support JPG pictures......but gif are acceptable .....the pictures I converted using this code WORK fine dere......... so it works for me!
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: VB6 - ADD and REMOVE EXTENSIONs TO ALL FILES In A FOLDER

    It does not work - the program is capable of loading both types of pictures, and luckily ignores the extension (which is what has fooled you into thinking it works).

    What determines how a file can be loaded is not the extension (which is basically just an indicator for which program should try to load it), but the contents of the file. If you open a picture file in Notepad, no matter what the file extension has been changed to, you will see that the first few characters of a Jpeg file are JFIF, and a GIF file starts with something like yoya.


    It seems that JPG pictures are fine for your mobile, but for some reason it doesn't like the extension you had. There are several extensions that are apt for JPeg pictures (including .JPG, .JPEG, .JFIF), so try another one.

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: VB6 - ADD and REMOVE EXTENSIONs TO ALL FILES In A FOLDER

    Totally, 100% plus, agree with si_the_geek & edgemeal. Renaming a file's extensions does not convert anything.

    As for a reason to rename extensions? I can think of one that I have used in the past. Let's say I have a text parser/reader that only supports specific file extensions. If I have ascii files with extensions of .xyz that must be changed to .txt for that app to work right, then a project like yours could be useful. In the past, I'd simply use a command prompt and rename the files. I found that easier than writing a script or project.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width