Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Command line parameters for Notepad?


  • Please log in to reply
8 replies to this topic
Boskoop
  • Members
  • 75 posts
  • Last active: Jan 11 2011 09:12 PM
  • Joined: 01 Jan 2005
It's possible to print any file with notepad /p filename.xyz
Does anybody know about other command line parameters for notepad?

Thanks
Kai

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
In case it's of interest, most documents can be printed via their associated apps by using "print" as the first word of the run command:

Run print "C:\My Documents\My File.doc"

The effect should be the same as if you had chosen "Print" from Explorer's right-click context menu.

  • Guests
  • Last active:
  • Joined: --
Thanks for the answer.

"Run, notepad /p MyFile.xyz "
works fine printing files with no associated program (testet in Win2000 and WinXP). I never tried "run, print" for this.

The background of my question:
There's a lot of changes (text-style, getting rid of page number and filename in the print, ....) one can do by Notepad-GUI. Would be nice to do this by command line parameters for getting finer prints. If there are any.

Kai

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
A quick search using Google and MSDN brings up nothing about more parameters, nor is there anything in the help file for it. Experimentation with different parameters that are common to almost all that support them on Windows brings up results that suggest it only supports one filename as a parameter. /p also works, but that's about it.

BoBo
  • Guests
  • Last active:
  • Joined: --
Notepad ?

text-style

? Check --> MS-Write ...

BoBo
  • Guests
  • Last active:
  • Joined: --
nEdit: [Win32] or [Linux]

Boskoop
  • Members
  • 75 posts
  • Last active: Jan 11 2011 09:12 PM
  • Joined: 01 Jan 2005
Wow, that was much more support than I ever hoped for. There seems to be no command line parameters and I can stop searching. Thanks

@Bobo: Found a file write.exe in Windows\system32, but could't figure out what it does. When I try to start it directly or by command line, nothing happens at all.

NEdit: I will keep it in mind, when I get back to "script cosmetics". For the time being I'll live with courier, page numbers and file names in my prints. Thanks Autohotkey I have something to print at all :-)

Thanks again
Boskoop

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
On my system, Write.exe just opens up Wordpad. It appears to be an AppPath alias.

Boskoop
  • Members
  • 75 posts
  • Last active: Jan 11 2011 09:12 PM
  • Joined: 01 Jan 2005
I did find some sort of workaround. It's possible to make notepad remember the last used configuration (like "no page number" "no file name" in print) by adding a new key to the registry:

1. Close notepad
2. Look for HKEY_CURRENT_USER\Software\Microsoft\Notepad
3. Add a new DWORD named "fSavePageSettings". The value must be 1.
4. After restarting windows notepad is cured of it's Alzheimer.

(Tested on WindowsXP)

Boskoop