Questions tagged [command-prompt]

The command prompt is the string of text that a command-line interpreter displays to you, the user, to prompt you for input in interactive mode. For programs with textual user interfaces in general, not specifically addressing their prompts for user input, see either the CONSOLE-APPLICATION (Microsoft Windows) or TERMINAL (Unices, MacOS 10, and Linux) tags. See COMMAND-LINE or SuperUser for commands invoked by command lines at a command prompt.

This tag covers questions addressing how to control the command prompt in various command interpreters, from sh to COMMAND, and programs that issue command prompts.

Command prompt reference material

4223 questions
89
votes
3 answers

How does the command prompt know when to wait for exit?

I was attempting to do a Windows command prompt re-code in C#. I was wondering how the command prompt knows when to wait for the process started to exit, and when not to wait for the called process to exit. For example, if you type in the command…
Justine Krejcha
  • 1,235
  • 17
  • 27
89
votes
4 answers

How do I type a TAB character in PowerShell?

Task: By default, pressing the TAB key while in Windows Command Prompt will output file names, while it does nothing in PowerShell. I want to be able to type the TAB character in interactive mode, not via scripts. Research: I found similar questions…
Hamman Samuel
  • 2,350
  • 4
  • 30
  • 41
87
votes
9 answers

How can I set / change DNS using the command-prompt at windows 8

How can I set my DNS settings using the command-prompt or bat file at windows 8 I tried this: netsh interface ip set dns name="Local Area Connection" source=static addr=none but not worked.
Zuhair Taha
  • 2,808
  • 2
  • 35
  • 33
79
votes
24 answers

Changing default startup directory for command prompt in Windows 7

How do I change default startup directory for command prompt in Windows 7? I usually do the following to start command prompt from C:\ WIN-R (Run Prompt) cmd /K cd C:\ I want to do the following to start command prompt from C:\ WIN-R (Run…
aung
  • 793
  • 1
  • 6
  • 5
77
votes
10 answers

Opening Chrome From Command Line

I have the following batch file: @echo off REM Starts a chrome browser with multiple tabbed sites C:\Users\UserName\AppData\Local\Google\Chrome\Application\chrome.exe "site1.com" "site2.com" But when I run it, it causes the prompt to hang and…
user1473784
  • 901
  • 1
  • 6
  • 8
76
votes
16 answers

PS1 line with Git current branch and colors

Here is my current PS1: export PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' How can I display the current branch in a different color?
cfischer
  • 24,452
  • 37
  • 131
  • 214
75
votes
14 answers

How do I minimize the command prompt from my bat file

I have this bat file and I want to minimize the cmd window when I run it: @echo off cd /d C:\leads\ssh call C:\Ruby192\bin\setrbvars.bat ruby C:\leads\ssh\put_leads.rb I want the command window minimized immediately. Any ideas on how to do this?
Matt Elhotiby
  • 43,028
  • 85
  • 218
  • 321
75
votes
3 answers

PowerShell The term is not recognized as cmdlet function script file or operable program

I am implementing a script in powershell and getting the below error. The sceen shot is there exactly what I entered and the resulting error. At this path there is file Get-NetworkStatistics.ps1 which I got from Technet Gallery. I am following the…
user3505712
  • 895
  • 1
  • 11
  • 20
71
votes
12 answers

How to use passive FTP mode in Windows command prompt?

In Ubuntu ftp -p for passive mode works fine. How do I do the same in Windows? I tried with quote pasv but I am getting following error: 230 OK. Current restricted directory is / ftp> quote pasv 227 Entering Passive Mode (31,170,167,221,116,239) …
user2737208
69
votes
6 answers

How to write multiple lines of code in Node REPL

I would like to evaluate var foo = "foo"; console.log(foo); as a block, instead of evaluating line by line var foo = "foo"; undefined console.log(foo); foo undefined Is there a simple way to move the prompt to the next line?
aksanoble
  • 2,480
  • 4
  • 18
  • 19
68
votes
4 answers

How to get all Windows service names starting with a common word?

There are some windows services hosted whose display name starts with a common name (here NATION). For example: NATION-CITY NATION-STATE NATION-Village Is there some command to get all the services like 'NATION-'. Finally I need to stop, start…
Chandan Kumar
  • 2,617
  • 2
  • 19
  • 20
67
votes
9 answers

How can I move all the files from one folder to another using the command line?

What is the best command to move all files from one folder to another? I want to do this from within a batch file.
Chirag
  • 1,919
  • 6
  • 25
  • 33
67
votes
6 answers

Hide input on command line

I know that command line interfaces like Git and others are able to hide input from a user (useful for passwords). Is there a way to programmtically do this in Java? I'm taking password input from a user and I would like their input to be "hidden"…
kentcdodds
  • 27,113
  • 32
  • 108
  • 187
65
votes
7 answers

How to run a command on command prompt startup in Windows

EDIT If you want to perform any task at computer startup or based on an event this is very…
Rajkiran
  • 15,845
  • 24
  • 74
  • 114
64
votes
6 answers

How do I change the default virtualenv prompt?

How do you change the default Virtualenvwrapper prompt? By default, working on a particular virtual environment with a command like workon <_name_of_env_> prepends the name of the virtualenv to your prompt. This may work poorly if you're not using…
kevin
  • 2,998
  • 4
  • 23
  • 17