none
.txt opens in CMD RRS feed

  • Question

  • well i was messing around with text files seeing if i can make them appear like a batch... since then my .txts open with a batch that says

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

    C:\Users\Kyle\Desktop>

    any way to fix this? i attempted to set it via set associations in control panel but it doesn't change :(
    Friday, March 12, 2010 2:50 AM

Answers

  • Thanks for your reply.

    First of all, right click a txt file and choose “Open with”. Select Notepad. Does the file cannot be opened properly? If yes, try to right click a txt file and choose “Open with”->Change Default programs, locate the Notepad and set it as default programs.

    If the issue persists, import a good [HKEY_CLASSES_ROOT\.txt] key  to repair.
    http://cid-f88cf0904fc13266.skydrive.live.com/self.aspx/.Public/orginal%5E_TXT%5E_ASSOC.reg

    Meanwhile, since you have done the association change, it also changed the registry value of them.
    Now I found a solution for you:
    1. Click start button, input regedit in the search box, and right click the regedit , hit Run as administrator,
    2. Go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice
    First export UserChoice to your desktop as backup and delete it from registry. Then close the registry editor and restart the computer.
    3. Log on your account, double-click a .txt file, you will be prompted “To open this file with:”
    4. Select “Select a program from a list of install programs”, hit OK,
    5. Now you can choose Notepad or etc

    Also you can install some kind of notepad-style application, then associate the .txt files with it.

    By the way, can you share your method to associate .txt file  with .batch:>

    Monday, March 15, 2010 10:04 AM

All replies

  • Greetings,

    You must run the command as an Administrator permission:
    1. Open the Start Menu, input “cmd” in the search box
    2. Right Click Command Prompt ,click Run as Administrator
    If Windows 7 will ask you if you were sure that you wanted to open the command prompt as an administrator, click Yes.
    3. Input the following command and hit Enter :

               cmd /c assoc .txt=notepad

    It works on my Windows 7. What error message do you see if it fails?

    Meanwhile, you can try set file association via Default Program as a try.
    1. Open start menu, input default program in the search box and hit Enter
    2. Click “Associate a file type or protocol with a program” , you will see a screen Set Associations
    3. Select “.txt” to highlight blue, click Change program…
    4. Then select Notepad in the Open with dialog box, click OK.
    5. After refreshment, it finishes modification and check if you can use your .txt files as intended.

    If the issue still persists, you can run System Restore to the correct status.
    Click start button, type rstrui into the search box and hit Enter.
    You will immediately see a screen, click Next, then you can choose to roll back the system to the restore point before you messed around.
    Just click Next, then Finish. If prompted, just hit Yes.
    Then you will wait for the end of the Restore and log on after it restarts.

    Hope it will help you!
    PS: You can share your method about How to associate .txt with batch command.

    Friday, March 12, 2010 6:27 AM
  • Saddly none worked >:[ and the restore point is only a day behind i did this atleast 2 days after i installed windows 7 (back around new years) could you possibly give me a hand via Team Viewer :(?
    Monday, March 15, 2010 6:48 AM
  • Thanks for your reply.

    First of all, right click a txt file and choose “Open with”. Select Notepad. Does the file cannot be opened properly? If yes, try to right click a txt file and choose “Open with”->Change Default programs, locate the Notepad and set it as default programs.

    If the issue persists, import a good [HKEY_CLASSES_ROOT\.txt] key  to repair.
    http://cid-f88cf0904fc13266.skydrive.live.com/self.aspx/.Public/orginal%5E_TXT%5E_ASSOC.reg

    Meanwhile, since you have done the association change, it also changed the registry value of them.
    Now I found a solution for you:
    1. Click start button, input regedit in the search box, and right click the regedit , hit Run as administrator,
    2. Go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice
    First export UserChoice to your desktop as backup and delete it from registry. Then close the registry editor and restart the computer.
    3. Log on your account, double-click a .txt file, you will be prompted “To open this file with:”
    4. Select “Select a program from a list of install programs”, hit OK,
    5. Now you can choose Notepad or etc

    Also you can install some kind of notepad-style application, then associate the .txt files with it.

    By the way, can you share your method to associate .txt file  with .batch:>

    Monday, March 15, 2010 10:04 AM
  • restarting now Registry editing fixes all. :P but it is a tricky disco. 'By the way, can you share your method to associate .txt file  with .batch' 
    I would if it worked XD as you can see i failed :p
    Tuesday, March 16, 2010 7:03 AM
  • Thanks Martin thats works. 
    abhishek
    Monday, May 30, 2011 4:36 PM
  • I found a way VERY close to yours and it will work 100%

    1. Click start, Type 'regedit', Right click it and Run As Administrator

    2.Goto HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\UserChoice

    3. Double click the file name 'Progid' (ITS NOT A FOLDER) then change it's value to:

    Applications\notepad.exe

    4. Open a .txt file, it will work!




    • Edited by Vindi Quartz Friday, July 25, 2014 9:46 PM Unprecise
    Friday, July 25, 2014 9:44 PM
  • Best solution:

    Open Default Programs in Start Menu.

    Click "Set your deafult programs"

    Select Wordpad from Dropdown menu and then click on "Choose defaults for this program".

    Check all the 4 boxes and click save.

    Go to txt document: right click it >> Open With >> Always open with Notepad.

    Hurray!! Issue Solved :P.


    • Edited by Nimishb Friday, March 22, 2019 3:07 PM Extra addition
    Friday, March 22, 2019 3:06 PM
  • Alternate Solution my best way

    1. Right click on the text file which opens in cmd

    2. Select "Open with"

    3. Click on "Choose default program..."

    4. Select "Notepad on Recommended Programs or Other Programs" (if notepad is not listed Browse notepad with following location C:\Windows\notepad.exe)

    5. On bottom Tick mark on "Always use the selected program to open this kind of file"

    6. Click OK

    Next time if you double click the text file it opens normally.

    Friday, March 22, 2019 3:17 PM