Calling Notepad.exe from Registry 'ShellNew'

Archived from groups: microsoft.public.windowsnt.misc (More info?)

Hi all,

Just a quick question if I may:

I have a situation where I want to be able to create a new text document using
the 'New' entry on my right-mouse context menu. after a bit of experimentation I
find the syntax of:

[HKEY_CLASSES_ROOT\.txt]

[HKEY_CLASSES_ROOT\.txt\ShellNew]
"Command"="D:\\WinNT\\System32\\Notepad.exe J:\\Untitled.txt"

will basically achieve what I want. If you try calling Notepad.exe WITHOUT the
trailing filename, this entry crashes Explorer.exe :-(

Of course 'Untitled.txt' does not exist, so when Notepad launches, you get the
error dialog of "Cannot find the Untitled.txt file. Do you want to Create it?"

Does anyone know of a method of suppressing this dialogue, so notepad just
opens, or alternately, a better syntax for the ShellNew command ?

Calvin.

PS: I actually asked this question a couple of weeks ago in the
microsoft.public.windowsnt.registry newsgroup, and nobody responded :-(
2 answers Last reply
More about calling notepad registry shellnew
  1. Archived from groups: microsoft.public.windowsnt.misc (More info?)

    Hi, Calvin, hope I can help. I'm thinking what you want to do
    is something like this instead.

    [HKEY_CLASSES_ROOT\.txt\ShellNew]
    "NullFile"=""

    At least that's what's working here for the moment...
    But I'm confused, don't you already have that right click
    choice as a default item? I guess I don't understand why
    you want something you should already have, unless you
    want it in some different flavor? Active Desktop Update
    not installed? It is here and I'm betting that this is an
    added 'goody' of that?

    I'm not surprised nobody answered, deep registry questions
    often are ignored.

    You might try this for a different syntax attempt.
    "Command"="D:\\WinNT\\System32\\Notepad.exe %1"

    D:??? Is that the right drive letter?

    Lee

    Calvin <nospam@spamcop.net> wrote in message news:<415c918e$1@duster.adelaide.on.net>...
    > Hi all,
    >
    > Just a quick question if I may:
    >
    > I have a situation where I want to be able to create a new text document using
    > the 'New' entry on my right-mouse context menu. after a bit of experimentation I
    > find the syntax of:
    >
    > [HKEY_CLASSES_ROOT\.txt]
    >
    > [HKEY_CLASSES_ROOT\.txt\ShellNew]
    > "Command"="D:\\WinNT\\System32\\Notepad.exe J:\\Untitled.txt"
    >
    > will basically achieve what I want. If you try calling Notepad.exe WITHOUT the
    > trailing filename, this entry crashes Explorer.exe :-(
    >
    > Of course 'Untitled.txt' does not exist, so when Notepad launches, you get the
    > error dialog of "Cannot find the Untitled.txt file. Do you want to Create it?"
    >
    > Does anyone know of a method of suppressing this dialogue, so notepad just
    > opens, or alternately, a better syntax for the ShellNew command ?
    >
    > Calvin.
    >
    > PS: I actually asked this question a couple of weeks ago in the
    > microsoft.public.windowsnt.registry newsgroup, and nobody responded :-(
  2. Archived from groups: microsoft.public.windowsnt.misc (More info?)

    Hi Lee,

    Thankyou for taking the time to respond.

    I'll try the 'NullFile' option again - I'm sure I had the syntax right last
    time, the result was nothing (ie: Notepad didn't launch, no error messages, no
    nothing :-( )

    Im answer to your question, yes the path is correct, notepad is located in the
    D:\WinNT\System32\ folder. The machine I'm working on is configured to
    approximate the layout as suggested in http://nt4ref.zcm.com.au/bigdisk.htm -
    with separate system and boot partitions.

    The syntax I posted (as a .reg file) in my original message functions correctly
    (ie: Notepad launches) but of course, it is looking for said file 'Untitled.txt'
    and generates the error dialogue because it doesn't exist.

    As I explained also in my last post using the syntax of "notepad.exe %1" crashes
    Explorer - that is the desktop freezes up, then after the time out period, NT
    realises the shell has died and restarts it, with the corresponding entry in the
    Applications event log.

    I'm afraid I have no intention of installing 'Active Desktop' - this supposed
    add-on is a menace, and is responsible for more than half the cases of
    instability I see in NT4 machines that I maintain. In fact, IE is also banned
    from these machines, for exactly the same reasons (and the much more important
    consideration that IE opens the machine up to innumerable security holes)

    I'll have to take some time and have another play around. I was hoping someone
    could point me in the direction of a good reference work on this topic of 'Shell
    Extensions'. I've done a couple of Google searches and found some material, but
    most articles still seem to leave out a lot of the details. Of course the
    biggest problem with using a search engine to find information is knowing the
    right question to ask :-) I was hoping somebody may have had more luck than me
    finding this missing detail.

    All the best.

    Calvin.
Ask a new question

Read More

Notepad Command Prompt Microsoft Windows