Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Every time I open a text (.txt) document on my PC (Windows 7 Ultimate x64), it immediately begins printing on my default printer.

What is happening and how do I turn it off?

share|improve this question
add comment

4 Answers

up vote 6 down vote accepted

Perhaps you have something like a /p in the file association since running notepad /p filename.txt will immediately print the file on the default printer.

C:\>assoc .txt
.txt=txtfile

C:\>ftype txtfile
txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1

Of course this depends on exactly how you "open a text (.txt) document", For example, if you mean you run MS Word and use it's File, Open dialogue, you probably have a different problem.


EDIT

assoc and ftype provide an incomplete means of editing registry entries. My PC has under HKEY_LOCAL_MACHINE\SOFTWARE\Classes

\txtfile\shell\open\command    %SystemRoot%\system32\NOTEPAD.exe %1"
\txtfile\shell\print\command   %SystemRoot%\system32\NOTEPAD.exe /p %1"

(The key name and type are (Default) and REG_EXPAND_SZ respectively.)

There may have been some incorrect values (or missing entries) that cause the described problem.

Using ftype and assoc to attempt to correct this obviously carries fewer risks than editing the registry directly.

share|improve this answer
    
I "open" a txt file by double-clicking on it or right-clicking and choosing Open. –  Anthony Mastrean Jan 19 '11 at 15:09
    
Here's the output of the commands you noted... c:\>assoc .txt => .txt=txtfile AND c:\>ftype txtfile => File type 'txtfile' not found or no open command associated with it. –  Anthony Mastrean Jan 19 '11 at 15:10
1  
Try ftype txtfile="%SystemRoot%\system32\NOTEPAD.EXE %1" –  RedGrittyBrick Jan 20 '11 at 10:15
    
YES! that last command set the ftype (I checked with the command ftype txtfile) and when I opened a txt file, Windows asked me to associate it with a program. I chose Notepad. and it opened normally! –  Anthony Mastrean Jan 21 '11 at 15:43
add comment

Delete this key from the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\txtfile\

Right click on a .txt file, choose Open With > Notepad. All will be okay.

share|improve this answer
    
This answer of deleting the registry key and then opening Notepad worked perfectly for me. All I would say is make sure it is the txtfile you delete, not the txt one. –  user105172 Nov 12 '11 at 22:42
add comment

Go to Control Panel (icon view) Default Programs, then click "associate a file type or protocol with a program"

Scroll down to .txt , it should be associated with Notepad, is it?

If it is not, double click it and select Notepad

.

share|improve this answer
    
It is set to Notepad. –  Anthony Mastrean Jan 18 '11 at 21:15
    
Does the test document open, then it starts printing? Try updating your printer software to the latest version. –  Moab Jan 18 '11 at 21:16
    
How about changing it to another program like Wordpad, then setting it back to Notepad? –  Martheen Cahya Paulo Jan 18 '11 at 21:19
    
I tried cycling the associated program, it auto-prints still. –  Anthony Mastrean Jan 18 '11 at 21:22
add comment

I had the same problem on my home PC (what's going on!?) and the FTYPE command that RedGrittyBrick suggested did not work this time. I had to modify the registry manually. I had to modify the type of the registry key using the command line.

reg.exe add <key> /ve /t REG_EXPAND_SZ /d "<value>"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.