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
37
votes
3 answers

Custom Bash prompt is overwriting itself

I'm using custom bash prompt to show git branch. Everything is in /etc/bash/bashrc: function formattedGitBranch { _branch="$(git branch 2>/dev/null | sed -e "/^\s/d" -e "s/^\*\s//")" # tried these: echo -e "\e[0;91m ($_branch)" …
A.D.
  • 4,487
  • 3
  • 38
  • 50
36
votes
3 answers

Prevent overwriting a file using cmd if exist

I am currently writing a .bat batch file that executes an installation file. Before it runs the installation file I check to see if the directory exists to avoid re-installing the application. I do this by using a If Not Exist filename statement. If…
Johnrad
  • 2,637
  • 18
  • 58
  • 98
36
votes
1 answer

Terminal vs Console vs Shell vs Command Prompt?

I find myself using these terms interchangeably without knowing the difference.What is the actual difference between all these terms?
dsynkd
  • 1,999
  • 4
  • 26
  • 40
36
votes
6 answers

Visual Studio Command Prompt vs. a regular command prompt?

When I open a Visual Studio command prompt (for example, opened with menu Start -> Programs -> Microsoft Visual Studio 2008 -> Visual Studio Tools -> Visual Studio 2008 Command Prompt), I get: Setting environment for using Microsoft Visual Studio…
John B
  • 20,062
  • 35
  • 120
  • 170
35
votes
6 answers

Batch file to split .csv file

I have a very large .csv file (>500mb) and I wish to break this up into into smaller .csv files in command prompt. (Basically trying to find a linux "split" function in Windows". This has to be a batch script as my machine only has windows installed…
SeekingAlpha
  • 7,489
  • 12
  • 35
  • 44
34
votes
4 answers

CP command prompt Windows 7 not recognized

I am trying to run the command CP at the command prompt on Windows 7 but I'm getting: 'cp' is not recognized as an internal or external command, operable program or batch file. Do I need to install any software to run "cp" command? If so what?
Satch3000
  • 47,356
  • 86
  • 216
  • 346
34
votes
3 answers

How to copy files from folder tree dropping all the folders with Robocopy?

I have the following folder structure: FolderA --Folder1 --Folder2 --Folder3 ... --Folder99 Folders 1 through 99 have files in them. All I want to do is to copy ALL THE FILES into ONE FOLDER, basically do a FolderA copy, and wipe out Folders 1-99…
roman m
  • 26,012
  • 31
  • 101
  • 133
33
votes
2 answers

Net.exe use 'Error: A command was used with conflicting switches.' while using /savecred

I am trying to use following command to map a drive in persistent mode, and I don't want it to ask login credentials everytime I reboot the machine: net use P: \\server\folder Password123 /user:user123 /savecred /persistent:yes But I am getting…
32
votes
2 answers

Run command2 only if command1 succeeded in cmd windows shell

How do we combine commands in cmd shell language such that the second command is only executed if the first command successfully completed? something like following bash-command make && ./a.out a.out is only executed if make was successful
user674669
  • 10,681
  • 15
  • 72
  • 105
32
votes
8 answers

Remove proxy settings from the windows command prompt

I had set proxy settings in cmd when I was in a proxy network as follows: set http_proxy=http://username:pass@hostname:port set https_proxy=https://username:pass@hostname:port Now that I am on a normal network I want to unset the proxy settings in…
ant_1618
  • 1,861
  • 4
  • 17
  • 26
32
votes
5 answers

How to see the proxy settings on windows?

Our work laptops are configured to use proxy to access external sites and I don't have access to see the proxy information. All our applications like IDEs are configured to use system proxy. Is there a way I can check the proxy settings; For…
l a s
  • 3,836
  • 10
  • 42
  • 61
32
votes
6 answers

How to answer to prompts automatically with python fabric?

I want to run a command which prompts me to enter yes/no or y/n or whatever. If I just run the command local("my_command") then it stops and asks me for input. When I type what is needed, script continues to work. How can I automatically respond to…
aemdy
  • 3,702
  • 6
  • 34
  • 49
31
votes
4 answers

How to run commands via NodeJS child process?

I am trying to run commands on Windows via NodeJS child processes: var terminal = require('child_process').spawn('cmd'); terminal.stdout.on('data', function (data) { console.log('stdout: ' + data); }); terminal.stderr.on('data', function…
Tower
  • 98,741
  • 129
  • 357
  • 507
31
votes
7 answers

How to get chrome version using command prompt in windows

Is it possible to get version installed chrome version using command prompt in windows? Tried, "C:\Program Files\Google\Chrome\Application\chrome.exe" -version "C:\Program Files\Google\Chrome\Application\chrome.exe" --version "C:\Program…
Sarath
  • 1,438
  • 4
  • 24
  • 40
31
votes
5 answers

remove last STDOUT line in Python

I am trying to figure out how to suppress the display of user input on stdout. raw_input() followed by any print statement preserves what the user typed in. getpass() does not show what the user typed, but it does preserve the "Password:" prompt. To…
javanix
  • 1,270
  • 3
  • 24
  • 40