Menu

CreatProcess() Failed wit Error Code 193

NppExec
2011-11-06
2013-05-21
  • Mike DeBruyn

    Mike DeBruyn - 2011-11-06

    I'm just learning Perl.  I put the first simple programs into Notepad++, saved them, and ran them in the CMD Window of Windows 7.  All went as expected.  Then I learned I could install the NPPExec plugin and run the programs straight from Notepad++.  Heaven :)

    I did the install of NPPExec right from Notepad++ (nothing fancy) and I get the referenced error, every time I run ANY program.  I've tried various options, saving the file, changing the extension from .TXT to .PL, etc.  Nothing changes.  I've read ALL of the documentation on NPPExec and found no inspiration there.

    Is there some kind of additional setup I need to do?  This has got to be some incredibly dumb user error, right?

    Here is the simplest program that fails.

    +++++
      use 5.010;
      use strict;
      use warnings;

      say "Hello World";

    +++
    And the console window shows:
    +++

    C:\Users\Mike\Desktop\TOOLS\programming\Hello.txt
    CreateProcess() failed with error code 193:

    ================ READY ================

    +++

    This program runs as expected from the CMD window.

    Any help will be greatly appreciated.  My bottle of aspirin is nearly empty.  :)

     
  • Mike DeBruyn

    Mike DeBruyn - 2011-11-06

    Oh, I failed to mention that I DID enter : $(FULL_CURRENT_PATH) into the command window and also I get the same error if I use "<temporary script>" or use the Save option to force a save.

    Thanks again.

     
  • DV

    DV - 2011-11-07

    > I've read ALL of the documentation on NPPExec and found no inspiration there. 
     
    Really? What about (Notepad++ main menu) Plugins -> NppExec -> Help/Manual ?? 
    Is there really no inspiration under the section "4. Advanced usage" and "4.7. Compiling"?
    But, anyway, I'd recommend to read the Manual from the very beginning since it has been intended to go from simplest things to advanced.

     
  • Mike DeBruyn

    Mike DeBruyn - 2011-11-09

    >> I've read ALL of the documentation on NPPExec and found no inspiration there.

    >Really?

    Really!  Else I would not be asking here.

    >What about (Notepad++ main menu) Plugins -> NppExec -> Help/Manual ??

    Is there some problem with your reading skills?  I clearly said that I read ALL of the available documentation and found no mention of a CreateProcess error.

    >Is there really no inspiration under the section "4. Advanced usage" and "4.7. Compiling"?

    No.  I am not compiling C, or Java or Visual Studio.  As stated above, in some detail, it is Pearl that I am trying to use.  And that is not really compiled at all, it is interpreted.  Again, if you read what I said … Pearl scripts run under the CMD prompt quite well.  What they do not do is run within Notepad++, as stated.  The CreateProcess error suggests that NPPExec is not able to properly pass parameters to Windows in some way that Windows likes so the CMD process is not able to be invoked from withing NPPExec.  ONCE MORE, as I SAID, if invoke Perl from the CMD window using the script file as a parameter all runs as expected.  The problem occurs when I press the Function Key to have NPPExec run it within NotePad++.  How can this be so hard for you to grasp … or is this just some kind of game for you?  Or maybe you got up on the wrong side of the bed?  Not had your morning coffee?

    If you are saying that Notepad++ is not CAPABLE of interpreting Perl within the NPPExec plugin, then that is another matter.  I can live with that.

    >But, anyway, I'd recommend to read the Manual from the very beginning since it has been intended to go from simplest things to advanced.

    Once again, I point you to what I wrote … I read the manuals, and in fact searched the web as well as this site for any mention of CreateProcess errors.

    I may have this all wrong, but is this a support forum or something else.  You seem to be treating this as some kind of treasure hunt where you dole out clues and I run around like a puppy sniffing the bushes to find the answer.  Either you can help or you can not.  If your goal is to convince me that you know things I don't, then fine and dandy.  I'll hope someone else both knows the problem I'm running up against and is willing to help.

    So, once more before I wander off in search of a programming editor that works, can anyone tell me what I may be doing wrong or at least confirm that this is a known bug in Notepad++ or NPPExec?

    Thank you to anyone who cares to be of some real help.

     
  • DV

    DV - 2011-11-10

    Please re-read your previous post and think would You want to help me if I would write something similar to you. 
    But, anyway, did you google for "error code 193"?
    If you would, you could read the following at the very first linked page: 

    ERROR_BAD_EXE_FORMAT 193 (0xC1)   %1 is not a valid Win32 application.

    Let me "translate" it: the system does not recognize the file you want to run as an executable and do not know how to run it. It's understandable because you wrote "I DID enter : $(FULL_CURRENT_PATH) into the command window" and your "$(FULL_CURRENT_PATH)" seems to be a Perl source file. For example, if you ask someone to run your Perl file, he/she would answer the same: I do not know how to run the Perl file. 
    In section 1.3. of NppExec Manual you can write: "NppExec is not a compiler. NppExec allows you to use external tools and compilers to process/compile your current file, but it has no ability to do it by itself. No magic here :)" Does it mean something to you? NppExec is NOT cmd.exe, NppExec is NOT a Perl compiler/interpreter. 
    Now you are probably thinking: why the hell this asshole has written all this shit without helping me? But I DID help. The problem is that you don't see the similarity of your task to 4.6.3. Processing & replacing the selection, 4.6.4. Run Python scripts with wxPython or 4.7.1. Compiling simple C-programs. 
    Let me generalize the task: 1. You need to tell NppExec WHAT to compile or run and 2. tell NppExec WHO will run or compile. 
    While specifying "$(FULL_CURRENT_PATH)", you told WHAT to compile or run, but did not tell WHO would do it. If you look closer to 4.7.1. Compiling simple C-programs, you can observe "C:\tools\tcc\tcc.exe "$(FULL_CURRENT_PATH)" -run" there. And there WERE explanations whay and what for. So, if you have your Perl interpreter/compiler somewhere in "C:\Program Files\Perl\perl.exe", you should specify something like 

    "C:\Program Files\Perl\perl.exe" "$(FULL_CURRENT_PATH)"
    

    to run/execute your Perl script. I wrote "something like" because you may or not may to have to specify some Perl-specific command line parameters.

     
  • Mike DeBruyn

    Mike DeBruyn - 2011-11-10

    > Please re-read your previous post and think would You want to help me if I would write something similar to you.

    OTOH, I would not have written your dismissive response to me.  But moving on…

    > But, anyway, did you google for "error code 193"? If you would, you could read the following at the very first linked page: "ERROR_BAD_EXE_FORMAT 193 (0xC1) %1 is not a valid Win32 application."

    Actually I did, Google is my first line of defense in this situation.  I actually Googled with the specific words in the error message and got 10,700 hits.  I went through several pages and none were helpful.  It seems as if most approaches have to do with specific product's problems.  Using your search parameter, I got 3.420,000 hits. The first one I got was not the same as the one you did.  Mine said it was from a corrupt system file and I needed to download their scanner to scan for system file errors.  That is not my problem.  I scan regularly and have no system file problems that can be found by Norton.

    > Let me "translate" it: the system does not recognize the file you want to run as an executable and do not know how to run it. It's understandable because you wrote "I DID enter : $(FULL_CURRENT_PATH) into the command window" and your "$(FULL_CURRENT_PATH)" seems to be a Perl source file. For example, if you ask someone to run your Perl file, he/she would answer the same: I do not know how to run the Perl file. In section 1.3. of NppExec Manual you can write: "NppExec is not a compiler. NppExec allows you to use external tools and compilers to process/compile your current file, but it has no ability to do it by itself. No magic here :)" Does it mean something to you? NppExec is NOT cmd.exe, NppExec is NOT a Perl compiler/interpreter.

    Yes, I got that much.  Well, part of it.  NPPExec does INVOKE CMD.EXE and pass parameters to it.  I fully expected NPPExe to simply PASS my program to the CMD window.  From the documentation I gathered that NotePad++ knows about Perl (as it is one language that you can select), and that NPPExec knows what to do with the languages NotePad++ knows about.  I can see where that might be an invalid assumption.  In reading the NPPExec manual I saw that one CAN write code to tell NPPExec SPECIFICALLY how to invoke C, for example.  But I did not gather that to simply take all the defaults that it was necessary to write code for NPPExec.

    > Now you are probably thinking: why the hell this asshole has written all this shit without helping me?

    Actually, no.  This response is very helpful.  At least it gives me some information other than "Read the manual, you moron." (After I read the manual.)  So I do thank you for taking the time to respond at some length.

    > But I DID help. The problem is that you don't see the similarity of your task to 4.6.3.

    Yes, that is true.  I did not see anything in those chapters that seemed to apply to me.  In my (obviously mistaken view) all I needed was to have my script passed to the CMD window.

    >Processing & replacing the selection, 4.6.4. Run Python scripts with wxPython or 4.7.1. Compiling simple C-programs. Let me generalize the task: 1. You need to tell NppExec WHAT to compile or run and 2. tell NppExec WHO will run or compile. While specifying "$(FULL_CURRENT_PATH)", you told WHAT to compile or run, but did not tell WHO would do it.

    That makes loads of sense.  As I said, I mistakenly assumed that since NotePad++ knows about Perl, then NPPExec would too.

    > If you look closer to 4.7.1. Compiling simple C-programs, you can observe "C:\tools\tcc\tcc.exe "$(FULL_CURRENT_PATH)" -run" there. And there WERE explanations whay and what for. So, if you have your Perl interpreter/compiler somewhere in "C:\Program Files\Perl\perl.exe", you should specify something like "C:\Program Files\Perl\perl.exe" "$(FULL_CURRENT_PATH)" to run/execute your Perl script. I wrote "something like" because you may or not may to have to specify some Perl-specific command line parameters.

    That makes sense and is actually what I was looking for to start.  When I saw the "$(FULL_CURRENT_PATH)"  instruction, I took it to mean that was ALL I had to do.  Perhaps if the writer of the NPPExec manual and put it as simply as you just did (above) I'd not have fallen down this pit.  FWIW, the exact string I needed was:

    c:\strawberry\perl\bin\perl.exe  $(FULL_CURRENT_PATH)

    Along the way I tried a number of variations until I got it right.  I can see the value of writing a batch file to set environment variables and such.  In particular, one of the variations I tried that did NOT work was to include "CMD" in front of that string.  Apparently NPPExec executes the CMD instruction and once there passes it CMD to open another instance then it just waits there for something to be input.  So, with your help and some trial and error, I can now execute scripts from NotePad++.

    Again, thank you for taking the time to give me the one bit of information I was missing.  With what you supplied I was able to better understand what the writer of the NPPExec documentation was trying to convey in 4.2,4, and 7.

     

Log in to post a comment.