How To Associate app for Files With No Extension


  1. Posts : 143
    Win 10 Pro 64bit
       #1

    How To Associate app for Files With No Extension


    Win 10 v1903. I get files from an app and these files do not have an extension. I can open and read them via Notebook but I'd like to assign Notebook to open them when I double click the file name.

    Can that be done in Win 10?

    -- Larry
      My Computer


  2. Posts : 5,330
    Windows 11 Pro 64-bit
       #2

    With this batch script you can add open with notepad to the windows context menu for all files.


    Code:
    @Echo Off & Cls
    
    net sess>nul 2>&1||(powershell start cmd -ArgumentList """/c %~0""" -verb Runas & exit)
    
    Cls & Mode CON  LINES=11 COLS=100 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.       
    Echo        Do You Want To Add Open with Notepad to the Windows Context Menu for All Files (Y/N)?   
    Echo.       
    Echo.
    Echo.
    
    
    Set /p input= RESPONSE: 
    If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start) 
    
    :_Ex
    If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)
    
    
    
    :_Start
    
    Reg add "HKCR\*\shell\Open with Notepad\command" /ve /t REG_SZ /d "notepad.exe %%1" /f >Nul
    Reg add "HKCR\*\shell\Open with Notepad" /v "Icon" /t REG_SZ /d "C:\Windows\Notepad.exe" /f >Nul
    
    Cls & Mode CON  LINES=11 COLS=45 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.       
    Echo        Open with Notepad Enabled   
    Echo.       
    Echo.
    Echo. 
    ping -n 6 localhost >nul 
    
    
    Exit
    
    
    
    
    :_RegRestore
    
    Reg Query "HKCR\*\shell\Open with Notepad" >Nul
    
    If %ErrorLevel% EQU 1 Goto :EOF
    
    
    Reg.exe delete "HKCR\*\shell\Open with Notepad" /f >Nul
    
    
    Cls & Mode CON  LINES=11 COLS=45 & Color 0E & Title Created By FreeBooter
    Echo.
    Echo.
    Echo.
    Echo.       
    Echo        Open with Notepad Disabled   
    Echo.       
    Echo.
    Echo. 
    ping -n 6 localhost >nul 
    
    Exit
      My Computer


  3. Posts : 143
    Win 10 Pro 64bit
    Thread Starter
       #3

    FreeBooter, I managed to remember how to turn your text script into a .bat file and execute it (as administrator). It works fine!

    Thank you!

    -- Larry
      My Computer


  4. Posts : 5,330
    Windows 11 Pro 64-bit
       #4

    You are very welcome!
      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 13:31.
Find Us




Windows 10 Forums