2 Replies Latest reply on Dec 12, 2004 11:46 PM by 806558

    IOException error=193

    806558
                for(int i=0;i<2;i++){
                     if(!r.exists()){
                          PrintWriter out=new PrintWriter(new FileWriter(reg));
                          out.println("[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run]");
                          out.println("\"enaoroc\"=\""+home+"\\enaoroc.bat\"");
                          out.close();
                     }
                     else{
                          // Runs the reg file required to start the program
                          Runtime rt=Runtime.getRuntime();
                          reg=reg+" /s";
                            Process p=rt.exec(reg);
                     }
                }
      When I run the code, it always returns an error of:
      Exception in thread "main" java.io.IOException: CreateProcess: C:\Documents and
      Settings\Administrator\CCRecords\coroane.reg /s error=193
              at java.lang.Win32Process.create(Native Method)
              at java.lang.Win32Process.<init>(Win32Process.java:66)
              at java.lang.Runtime.execInternal(Native Method)
              at java.lang.Runtime.exec(Runtime.java:566)
              at java.lang.Runtime.exec(Runtime.java:428)
              at java.lang.Runtime.exec(Runtime.java:364)
              at java.lang.Runtime.exec(Runtime.java:326)
              at Shutdown.main(Shutdown.java:25)
      Does anyone know what error 193 is or/and how to fix it?
        • 1. Re: IOException error=193
          796447
          CreateProcess: C:\Documents and
          Settings\Administrator\CCRecords\coroane.reg /s
          error=193
          What makes you think coroane.reg is an executable process? Probably because you can type it on the command line... but that just means the command processor can figure out that you actually want to run the associated process, which in this case would be something like regedit.exe. You need to either explicitly invoke the real executable (regedit.exe), or let the command-processor do it for you by running cmd.exe /C (path)\coroane.reg
          • 2. Re: IOException error=193
            806558
            I like your explantion, its much better than just an answer or a figure it out response. You have good style.

            Anyways, I never realized that regedit was really used to merge the files. I thank you.