cmd error=2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsn
    New Member
    • Sep 2007
    • 237

    cmd error=2

    hello everyone.
    i am using the process class with the runtime for sure. as you know i use it for running commands on my windows cmd.
    the usual commands work just fine such as, ping yahoo.com, ipconfig, and so much more.
    with my windows vista the stupid and annoying UAC (user access control is not letting my program to use the cmd as admin. so i have downloaded a program called start ++, this program is very useful, by using this command i can run the cmd normally, type in "sudo cmd.exe", and then an admin cmd pops up and i can run all my lovely commands.

    NOW IS THE PROBLEM and the reason for reading this post:

    when i use the process clas and enter the command "sudo cmd.exe /k ipconfig /flushdns" java says:

    Cannot run program "sudo": CreateProcess error=2, The system cannot find the file specified

    can someone help me to be able to make java run my command

    thanks for reading and see you at other posts

    regards
    hsn
  • hsn
    New Member
    • Sep 2007
    • 237

    #2
    sorry i forgot to say something

    i have windows VISTA when i use the start button i write in the search text field
    sudo cmd .exe
    and then the admin cmd runs

    Comment

    • Nepomuk
      Recognized Expert Specialist
      • Aug 2007
      • 3111

      #3
      Wow, interesting tool, that Start++. I assume, that the problem is the following:
      Java tries to execute the sudo command with cmd, however it is only known to the Start++ version of cmd. So, it should work with something like
      C:\path\to\star t++ sudo admin ...
      So, you'll have to find out, where Start++ has it's version of cmd.

      The best place to find this out is probably the Start++ Forum on brandontools.co m (where the Tool originates from).

      Greetings,
      Nepomuk

      Comment

      • hsn
        New Member
        • Sep 2007
        • 237

        #4
        thanks for your reply
        when i run cmd normally i enter "sudo cmd.exe" i understand your reply 100%, and i am looking through what you have told me. but isn't the process class with runtime runs a cmd process? and if so shouldn't it accept the command "sudo cmd.exe" just like the cmd which is being run by double clicking on its icon???

        Comment

        • hsn
          New Member
          • Sep 2007
          • 237

          #5
          also, sudo is a command in linux. what the creator of start++ did, is adding a service to windows. sudo is a super user command used in linux.
          i went to the path of start++ there is no sudo command or program over there.

          Comment

          • Nepomuk
            Recognized Expert Specialist
            • Aug 2007
            • 3111

            #6
            Originally posted by hsn
            when i run cmd normally i enter "sudo cmd.exe" [...] but isn't the process class with runtime runs a cmd process? and if so shouldn't it accept the command "sudo cmd.exe" just like the cmd which is being run by double clicking on its icon???
            Well, I don't know how exactly Start++ works, but I'm guessing, it either provides an own version of cmd (which wouldn't necessarily be called by Java) or it adds tools, which the normal cmd can use (in which case, the command "sudo cmd.exe" should work from Java, I think). As I said, the Start++ Forum is probably the best place to find that out.
            Originally posted by hsn
            also, sudo is a command in linux
            Indeed, it is. Knowing that, you can understand this comic: :-D
            Originally posted by hsn
            i went to the path of start++ there is no sudo command or program over there.
            Hm, have you searched your computer with the Windows search function? There may not be such a program, but you never know.

            Greetings,
            Nepomuk <--- Linux user

            Comment

            • hsn
              New Member
              • Sep 2007
              • 237

              #7
              well i searched in the prgram files.
              when i write in the start search the "sudo" command this comes up

              (Link)

              it is strange how that icon comes up. when ever i put any search key in the start search a small icon come up, but with this it is a huge icon
              strange
              Last edited by Nepomuk; Nov 15 '08, 03:36 PM. Reason: Now you can see the picture

              Comment

              Working...