Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: .exe files are now .exe.lnk - how do I fix??  (Read 3703 times)

0 Members and 1 Guest are viewing this topic.

kmw1550

    Topic Starter


    Newbie

    • Experience: Familiar
    • OS: Windows 7
    .exe files are now .exe.lnk - how do I fix??
    « on: September 01, 2014, 10:34:30 AM »
    Hi All,

    While downloading a game my son managed to turn .exe files to .exe.lnk. files.    Now none of the programs work.  Anyone know how to fix this?? 

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: .exe files are now .exe.lnk - how do I fix??
    « Reply #1 on: September 01, 2014, 11:03:13 AM »
    There is a batch file fix that can cure this. Had to rely on this in the past for a friends system that somehow tons of files got double file extensions, and only the first extension belonged and the last extension was wrong etc.

    A simple
    Code: [Select]
    rename *.exe.lnk *.exe will not fix this as I have tried, as for the rename function by itself can only change the last .xxx place holder in the file name, so if you ran rename *.exe.lnk *.lnk you end up with FileName.exe.exe in which now you need to drop one of the .exe's, although the files would probably launch ok now that the file association is met that states that its an exe which it is, however the extra .exe is still sloppy, especially if anything calls to the FileName.exe explicitly where FileName.exe.exe would be different and a mismatch.

    Here is a solution from this link: http://stackoverflow.com/questions/16486356/batch-file-to-find-files-with-double-file-extensions-and-remove-the-last-one


     
    Code: [Select]
    @ECHO OFF
    SETLOCAL

    SET sourcedir=c:\sourcedir
    FOR /r "%sourcedir%" %%i IN (*.*) DO (
     FOR %%n IN ("%%~ni") DO IF NOT "%%~xn"=="" IF NOT EXIST "%%~dpni" ECHO REN "%%~fi" "%%~ni"
     FOR %%n IN ("%%~ni") DO IF NOT "%%~xn"=="" IF EXIST "%%~dpni" ECHO CAN NOT REN "%%~fi" "%%~ni"
    )

    GOTO :EOF



    Other than this free batch program method, there are also programs out there such as Better File Rename that can correct for problems like this, that come at a cost. http://www.publicspace.net/windows/BetterFileRename/index.html