Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Command Prompt Doesn't Work  (Read 40792 times)

0 Members and 1 Guest are viewing this topic.

smlh89450

    Topic Starter


    Beginner

    Command Prompt Doesn't Work
    « on: August 26, 2007, 09:48:04 AM »
    I am running Windows XP Professional.  When I open command prompt and type "shutdown -s" command prompt says that it is not recognized as an internal or external command, operable program or batch file.  When I type in other commands like "ipconfig/all" it says the same thing.  However when I open Run and type in "shutdown -s" the command works fine.  Why is this?

    contrex

    • Guest
    Re: Command Prompt Doesn't Work
    « Reply #1 on: August 26, 2007, 12:13:25 PM »
    I am running Windows XP Professional.  When I open command prompt and type "shutdown -s" command prompt says that it is not recognized as an internal or external command, operable program or batch file.  When I type in other commands like "ipconfig/all" it says the same thing.  However when I open Run and type in "shutdown -s" the command works fine.  Why is this?

    1. Are you typing the space between shutdown and -s?
    2. Are you typing the quote marks that you have shown?
    3. there should be at least one space between a command such as ipconfig and any switches like /all. You have not typed a space.
    4. Do other commands work OK in command prompt?

    I suspect you are not typing them in right.







    « Last Edit: August 26, 2007, 12:49:40 PM by contrex »

    smlh89450

      Topic Starter


      Beginner

      Re: Command Prompt Doesn't Work
      « Reply #2 on: August 26, 2007, 08:00:24 PM »
      When I type in "shutdown -s" (without the quotation marks) in Run it works just fine.  When I do the same thing in Command Prompt, it says that it is not recognized.  I am pretty sure I am typing it in correctly if it works in Run.

      contrex

      • Guest
      Re: Command Prompt Doesn't Work
      « Reply #3 on: August 27, 2007, 12:38:39 AM »
      How are you getting to Command Prompt? We aren't talking about booting from a DOS floppy here are we?

      I am presuming you have admin privileges?

      Quote
      I am pretty sure I am typing it in correctly if it works in Run.

      Do a check for me?



      Carbon Dudeoxide

      • Global Moderator

      • Mastermind
      • Thanked: 169
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Experience: Guru
      • OS: Mac OS
      Re: Command Prompt Doesn't Work
      « Reply #4 on: August 27, 2007, 02:03:50 AM »
      If you go to Command Prompt and type shutdown /?, you should see a list of commands available. If it says something along the lines of "command not recognized", you don't have it.
      Go to C:\WINDOWS\System32 and look for any file called 'shutdown'

      If you don't see it there...Well unfortunately I don't know what to do from there, wait for a response from another member of CH.  ;) ;)

      contrex

      • Guest
      Re: Command Prompt Doesn't Work
      « Reply #5 on: August 27, 2007, 02:41:58 AM »
      If you go to Command Prompt and type shutdown /?, you should see a list of commands available. If it says something along the lines of "command not recognized", you don't have it.
      Go to C:\WINDOWS\System32 and look for any file called 'shutdown'

      If you don't see it there...Well unfortunately I don't know what to do from there, wait for a response from another member of CH.  ;) ;)

      The curious thing is, he says that he can type "shutdown -s" in the Run box (in the Start menu) and it does the expected thing.

      On the face of it, the only explanation is that shutdown.exe is not in a folder listed in his PATH system variable. Therefore that variable has become damaged or corrupted.

      A quick test for this would be to type "C:\Windows\System32\Shutdown" /? at the prompt (in any folder). If it works, the next step would be to check if C:\Windows\System32 is included in the PATH.

      I would be very interested to know what happens if smlh89450 -

      (1) Uses the Windows Search to find if c:\windows\system32\shutdown.exe actually exists on his computer.

      (2) Opens a command prompt in the folder c:\windows\system32

      (3) Issues a DIR shutdown.exe command and sees in its output that the executable is present.

      (4) If it is present, types shutdown.exe /? from the same prompt while still in that folder.

      (5) Types PATH at the prompt.

      If the file is found, and if it shows up in a command prompt DIR, my next step would be to investigate whether the folder name c:\windows\system32 is still included, and not mangled, in his PATH system variable. I suspect this may be at the root of his problem.

      The default path is C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem I believe.

      After all, the command prompt searches along the PATH for external commands (ie not internal to cmd.exe) and if it does not find them, returns the error described.

      The fact that ipconfig.exe lives in c:\windows\system32 also is making me wonder if a mangled PATH system variable is to blame... an incautious edit could damage it.

      The problem (alas, endemic in help forums) is that we may never know whether a guess was correct, since many users simply read the advice, shamefacedly realise their previous error, and never come back...

      To view or change environment variables:

      1.   Right-click My Computer, and then click Properties.

      2.   Click the Advanced tab.

      3.   Click Environment variables.

      4.   Click one the following options, for either a user or a system variable:

      •   Click New to add a new variable name and value.

      •   Click an existing variable, and then click Edit to change its name or value.

      •   Click an existing variable, and then click Delete to remove it.

      Reboot needed to see changes take effect.



      « Last Edit: August 27, 2007, 05:36:17 AM by contrex »

      smlh89450

        Topic Starter


        Beginner

        Re: Command Prompt Doesn't Work
        « Reply #6 on: August 27, 2007, 08:27:27 AM »
        This information might help.  My system value is C:\WINDOWS\system32\cmd.exe

        contrex

        • Guest
        Re: Command Prompt Doesn't Work
        « Reply #7 on: August 27, 2007, 08:37:21 AM »
        This information might help.  My system value is C:\WINDOWS\system32\cmd.exe

        Did you read my post above? have you done (1) to (5) ?


        smlh89450

          Topic Starter


          Beginner

          Re: Command Prompt Doesn't Work
          « Reply #8 on: August 27, 2007, 09:12:16 AM »
          Hi,
          c:\windows\system32\shutdown.exe exists, but when I try to open the file "shutdown," the command prompt window makes a brief appearance and then disappears.

          contrex

          • Guest
          Re: Command Prompt Doesn't Work
          « Reply #9 on: August 27, 2007, 09:16:27 AM »
          I need to know if you have opened a command window in c:\windows\system32? Do you know how to do that?
          « Last Edit: August 27, 2007, 10:07:46 AM by contrex »

          smlh89450

            Topic Starter


            Beginner

            Re: Command Prompt Doesn't Work
            « Reply #10 on: August 27, 2007, 06:58:01 PM »
            I guess not.  I just clicked on the file, nothing sophisticated.

            contrex

            • Guest
            Re: Command Prompt Doesn't Work
            « Reply #11 on: August 27, 2007, 11:38:58 PM »
            I want to know what happens when you open a command prompt and type these things in this order. [enter] means "press the enter key"

            c: [enter]

            cd c:\windows\system32 [enter]

            shutdown /? [enter]

            PATH [enter]





            « Last Edit: August 28, 2007, 02:15:39 AM by contrex »

            Carbon Dudeoxide

            • Global Moderator

            • Mastermind
            • Thanked: 169
              • Yes
              • Yes
              • Yes
            • Certifications: List
            • Experience: Guru
            • OS: Mac OS
            Re: Command Prompt Doesn't Work
            « Reply #12 on: August 28, 2007, 02:45:09 AM »
            Or you can drag shutdown.exe INTO the Command Prompt window and press Enter.

            contrex

            • Guest
            Re: Command Prompt Doesn't Work
            « Reply #13 on: August 28, 2007, 04:15:38 AM »
            Or you can drag shutdown.exe INTO the Command Prompt window and press Enter.

            Yes, quite so, but I also want to find out what folder names his PATH variable has got in it, seeing that shutdown.exe seems to work from the Run box but not from a cmd prompt in an arbitrary folder.







            smlh89450

              Topic Starter


              Beginner

              Re: Command Prompt Doesn't Work
              « Reply #14 on: August 28, 2007, 09:25:33 AM »
              Usage: shutdown [-i : -l : -s : -r: -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]

              No args
              -i
              -l
              -s
              -r
              -a
              -m \\computername
              -t xx
              -c "comment"
              -f
              -d [p]:xx:yy

              PATH=C:\Program Files\Java\jdk1.6.0_01\bin;C:\Program Files\Java\jdk1.6.0_01\bin

              contrex

              • Guest
              Re: Command Prompt Doesn't Work
              « Reply #15 on: August 28, 2007, 10:53:26 AM »
              PATH=C:\Program Files\Java\jdk1.6.0_01\bin;C:\Program Files\Java\jdk1.6.0_01\bin

              I thought as much! I was right!

              That is why shutdown.exe (and every other external command!!!!) won't work from the command prompt. Somehow your PATH variable has got seriously corrupted! This is a standard PATH as found on a new XP install

              Quote
              C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem

              Additions are supposed to be tacked on at the end, it looks like yours got nuked by whatever put that Java stuff there.

              Here's how to put things right

              1. Right click My Computer, choose properties.
              2. Choose Advanced tab.
              3. Click on Environment Variables button.
              4. in the System Variables (lower part) Highlight PATH. (You have to scroll down)
              5. Click the Edit button.
              6. The "Edit System variable" dialog comes up.
              7. The whole PATH string will be highlighted. Hit the END key to unhighlight it and position the typing cursor at the end.
              8. Type a semicolon ( ; )  at the end so it reads like this

              C:\Program Files\Java\jdk1.6.0_01\bin;C:\Program Files\Java\jdk1.6.0_01\bin;

              9. Copy this whole line to the clipboard

              C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem

              10. Paste it at the end of your PATH so it looks like this

              C:\Program Files\Java\jdk1.6.0_01\bin;C:\Program Files\Java\jdk1.6.0_01\bin;C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem

              11. OK three times to come right out.

              12. Reboot

              13. Check PATH looks like above.








              « Last Edit: August 28, 2007, 11:43:12 AM by contrex »

              smlh89450

                Topic Starter


                Beginner

                Re: Command Prompt Doesn't Work
                « Reply #16 on: August 28, 2007, 11:35:58 AM »
                Thank you so much.  Command Prompt works perfectly now!

                patio

                • Moderator


                • Genius
                • Maud' Dib
                • Thanked: 1769
                  • Yes
                • Experience: Beginner
                • OS: Windows 7
                Re: Command Prompt Doesn't Work
                « Reply #17 on: August 28, 2007, 03:53:56 PM »
                Nice piece of work contrex ! !

                 ;)
                " Anyone who goes to a psychiatrist should have his head examined. "

                contrex

                • Guest
                Re: Command Prompt Doesn't Work
                « Reply #18 on: August 28, 2007, 11:44:05 PM »
                Thank you.  :)