The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Command prompt opens then dissapears??

    Discussion in 'Windows OS and Software' started by Seekingknowledge, Jul 18, 2008.

  1. Seekingknowledge

    Seekingknowledge Notebook Enthusiast

    Reputations:
    0
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    5
    I have Vista Home Premium and when I type in a command...the black box window appears than dissapears immediately? Anyone has this issue or know how to fix this?
     
  2. royk50

    royk50 times being what they are

    Reputations:
    258
    Messages:
    1,975
    Likes Received:
    0
    Trophy Points:
    55
    first type cmd <enter>
    then type what you like

    if still have problems disable uac, or make sure you are running as administrator
     
  3. rubenvb

    rubenvb Notebook Consultant

    Reputations:
    10
    Messages:
    224
    Likes Received:
    0
    Trophy Points:
    30
    When you type a command in the start menu search box, it is executed (rapidly) in a command window, which, after the command has been executed, closes itself because the command it is meant to execute has been executed... ahum... pretty sleezy explanation, no?

    What the guy above me said should help... type cmd and enter, then you have a command window to stay. If you need admin rights, type cmd, wait for it to appear as a search result, right-click and select run as admin.

    There you go!
     
  4. Shyster1

    Shyster1 Notebook Nobel Laureate

    Reputations:
    6,926
    Messages:
    8,178
    Likes Received:
    0
    Trophy Points:
    205
    generally, if you run a command console command from the Start->Run window, the command console window will open, execute the command in question, and then automatically close. If you want it to stay open after the command runs, first do Start->Run->cmd, which will open a command console shell instance and give you a command prompt. From there, type the command you want to run, it will execute, and the shell will remain open once execution has ended.

    Alternatively, if you want to type everything at once in the "Run" box, you'll need to include the /k switch to keep the command console shell open after execution finishes. So, for example, if you wanted to run "ipconfig /all" from the Run box and have the shell stay open so you can see what the results are, and you don't want to do the steps above, then do Start->Run and type cmd /k "ipconfig /all" in the Run window (keep the quote marks around ipconfig /all otherwise (I believe) the parameters won't be passed to the cmd.exe shell properly.
     
  5. swarmer

    swarmer beep beep

    Reputations:
    2,071
    Messages:
    5,234
    Likes Received:
    0
    Trophy Points:
    205
    Yup.

    Nope. UAC has absolutely nothing to do with it whatsoever.

    Yup, except you don't need the quotes. cmd /k ipconfig /all works fine... so does cmd /k echo hello.

    However, if the command you're trying to run has quotes, you may have some trouble... so in that case it's easier to run cmd first to open a command prompt and then type your command.
     
  6. royk50

    royk50 times being what they are

    Reputations:
    258
    Messages:
    1,975
    Likes Received:
    0
    Trophy Points:
    55
    the point about the uac was whether the commands typed fails to execute,
    not about the run box disappearing.
     
  7. Shyster1

    Shyster1 Notebook Nobel Laureate

    Reputations:
    6,926
    Messages:
    8,178
    Likes Received:
    0
    Trophy Points:
    205
    Thanks for the refresher; I couldn't remember if it was ok to go "naked" or if you had to go "quoted" so I went with the latter.
     
  8. Nocturnal310

    Nocturnal310 Notebook Virtuoso

    Reputations:
    792
    Messages:
    2,708
    Likes Received:
    0
    Trophy Points:
    0
    If you dont want the Black Window to close then press WinKey + R ,,,in the run window type 'cmd' then hit enter.


    the black window which opens will not close even after CMD is executed.
     
  9. ViciousXUSMC

    ViciousXUSMC Master Viking NBR Reviewer

    Reputations:
    11,461
    Messages:
    16,824
    Likes Received:
    76
    Trophy Points:
    466
    the /k worked good for what I wanted to do. not sure what it actually does though??

    I have several mame versions and keep the roms in one directory.

    I use a .bat file that I edit normally to launch mame and the game I want.

    However it gets hard to remember the game names.

    So I put a .bat file in the rom directory with this.

    cmd /k cd/mydirectory/tomy/mameexe

    running the bat will leave me with an open window on the right directory ready to type in the mame exe and game name.

    Using the start --> command sucks because then I would have to type the directory.
     
  10. Shyster1

    Shyster1 Notebook Nobel Laureate

    Reputations:
    6,926
    Messages:
    8,178
    Likes Received:
    0
    Trophy Points:
    205
    /k tells the cmd executable to not terminate the console session once it's finished processing the command it's been given to execute.