getting weird error trying to notepad a file

Discussion in 'Windows 64bit' started by Lynn McGuire, Feb 4, 2011.

  1. Lynn McGuire

    Lynn McGuire Guest

    "notepad dii.bat" refuses to open my dii.bat file and is giving
    me a error message box, "Cannot read registry path". Does anyone
    know what is going on here ? I am typing the notepad command
    into a command prompt window.

    Windows 7 x64 ultimate, Intel quad core, 8 GB ram.

    Lynn McGuire, Feb 4, 2011
    1. Advertisements

  2. Lynn McGuire

    Jeff Layman Guest

    No idea. Has it worked ok before?

    What happens if you right click the file and select "Send to Notepad"?
    Jeff Layman, Feb 4, 2011
    1. Advertisements

  3. any chance you've got a command prompt open that is 32-bit, and you're
    trying to run 64-bit notepad? Or vice-versa? (actually, 32-bit notepad and
    64-bit cmd prompt is more likely.)
    Charlie Russel-MVP, Feb 4, 2011
  4. Lynn McGuire

    VanguardLH Guest

    Back in the DOS days, an executable was found by looking in the current
    (working) directory and, if not found, looking through the PATH
    environment variable (in the order the directories were listed).
    However, in NT-based versions of Windows, another method of finding
    executables is to store their paths in the registry. See the "Search
    Paths" section of where the
    entries are recorded under:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

    What's is peculiar in your case is that the C:\Windows\system32 path
    should be included in the PATH environment variable. If you look in the
    App Paths registry list, you won't see notepad.exe list. That's because
    it should be found by looking through the PATH environment variable
    (unless, of course, you happen to be in the C:\windows\system32
    directory at the time you execute notepad.exe). If you run:


    does the program load okay? What if you run your own non-pathed command
    line but include the .exe extension, as in "notepad.exe dii.bat"? It's
    possible there is another executable, like or notepad.bat,
    that gets found (by PATH or registry app path) before finding the .exe
    version. Always specify the full filename, including extension, to run
    an executable. If the executable cannot be found in the current
    directory (you didn't mention what it is in your command shell) or in
    the PATH variable or in the registry app path entries then you need to
    specify the full path to find the executable file.

    The check what is the current value for the PATH environment variable
    (both the user and system versions), run in a command shell:

    echo %path%
    set path (shows all env vars starting with "path")

    In the PATH var, is C:\Windows\System32 listed? Is anything listed?
    VanguardLH, Feb 4, 2011
  5. Lynn McGuire

    Lynn McGuire Guest

    Yes, my PATH is

    ;w:\pmrs;w:\cvsnt;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\

    C:\Windows\system32\notepad.exe works !

    I had a copy of notepad.exe in my c:\bin directory ! I have
    no idea how that got there.

    Sorry to bother you,
    Lynn McGuire, Feb 4, 2011
  6. That would do it!
    Charlie Russel-MVP, Feb 4, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.