How do I rename files with muliple file extensions in the name

Page 1 of 2 12 LastLast

  1. Posts : 3
    win7
       #1

    How do I rename files with muliple file extensions in the name


    I have been unable to find a quick solution to a simply problem concerning the accidental naming of windows files with quadruple file extensions. Windows 10 will allow someone to name a file test.txt.txt.txt.txt but I am also finding programs that double file extensions.In my case I was trying to help somone with 500 files with the extension created twice. My simply solution as example at the command prompt is to type ren *.txt.txt.txt.txt *... then ren *.txt.txt.txt *... then ren *.txt.txt *... OK this seems a little clumsy so where did I go wrong in finding a simply solution from the internet for people that often put a file extension on a file extension that windows would once not like.
      My Computer


  2. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #2

    Hi and welcome to WTF!

    Exactly what programs are creating duplicate file extensions?
    Is the user generated file suffix set incorrectly within the setup of the program or it's properties?

      My Computer


  3. Posts : 3
    win7
    Thread Starter
       #3

    The program is Band in the box 2004 . I renamed a group of its files in my docs but these files when copied to another laptop read as xyz.mgu.mgu (mgu being its file extension.

    - - - Updated - - -

    The fact that I have encountered a situation where something (possibly a rogue script) is doubling file extensions is not my concern but not finding a quick solution is. I have many a time created eample.txt.txt files myself. There are plenty of examples of how to change file name extensions but not how to remove them in groups.
      My Computer


  4. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #4

    If it is limited to this one program vs. programs, something is amiss within the Band software.

    Can you create the file without an extension and have the program append one instead?

    Also...

    Have you tried updating that software. It is a bit old. Maybe there's a fix.

    PG Music - Band-in-a-Box for Windows Updates

    FWIW.
      My Computer


  5. Posts : 3
    win7
    Thread Starter
       #5

    The file type setting in windows is correct. MGU ,SGU ,AND MGI are associated with band in the box.
    It recognises its files with or without an extension but windows was associating these files as awindows comshell but was not able to open them. I instructed windows to open these files with B and in the box. Ok but the filkes are stored in my documents and they were named in my documents as song.mgu or song.sgu Then they were put on a USB stick to another laptop where the files became song.mgu.mgu once copied to my documents in that laptop. Ok the guy doesnt want anything changed so let sleepy dogs lie - however what is the simply method of changing a 1000 files that have 2 or more file extensions so that they only have the one file extension and the file name is preserved.
      My Computer


  6. Posts : 9,792
    Mac OS Catalina
       #6

    You canuse Powershell with a script. Just have to do one file extension at a time. https://www.maketecheasier.com/batch...es-in-windows/
      My Computer


  7. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #7

    bro67 said:
    You can use Powershell with a script. Just have to do one file extension at a time. 3 Ways to Batch Rename Files in Windows - Make Tech Easier
    This is useful. Thanks.

    @quickfix2 - Hope that this website helps you.

    Perhaps a later version of the Band software might correct the problem.
    Maybe the company has a free trial for you to test with.

      My Computer


  8. Posts : 9,792
    Mac OS Catalina
       #8

    Compumind said:
    This is useful. Thanks.

    @quickfix2 - Hope that this website helps you.

    Perhaps a later version of the Band software might correct the problem.
    Maybe the company has a free trial for you to test with.

    Old school is sometimes easier. Write a script or batch with menu and you can do things faster in Cmd or PS than gui programs.
      My Computer


  9. Posts : 5,048
    Windows 10/11 Pro x64, Various Linux Builds, Networking, Storage, Cybersecurity Specialty.
       #9

    bro67 said:
    Old school is sometimes easier. Write a script or batch with menu and you can do things faster in Cmd or PS than gui programs.
    You bet. The CP/M and MS-DOS days are still alive, lol.

      My Computer


  10. Posts : 456
    Windows 10
       #10

    @quickfix2 I made a batch script that may help. Put it in the folder where the duplicated extensions are and run it. I'm putting it as attachment...

    Code:
    @echo off
    setlocal enabledelayedexpansion
    
    
    For %%a in (*) do (
    set name=%%a
    call :checkA
    call :checkB
    )
    exit
    
    :checkA
    If "!name:~-4,4!"=="!name:~-8,4!" (
    set name2=!name:~0,-4!
    ren "!name!" "!name2!"
    set name=!name2!
    goto checkA
    )
    goto :EOF
    
    :checkB
    If "!name:~-5,5!"=="!name:~-10,5!" (
    set name2=!name:~0,-5!
    ren "!name!" "!name2!"
    set name=!name2!
    goto checkB
    )
    goto :EOF
    How do I rename files with muliple file extensions in the name Attached Files
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:46.
Find Us




Windows 10 Forums