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
204
votes
17 answers

Compiling/Executing a C# Source File in Command Prompt

How do you compile and execute a .cs file from a command-prompt window?
Sajal Dutta
  • 18,272
  • 11
  • 52
  • 74
202
votes
4 answers

Why is my command prompt freezing on Windows 10?

I'm adding this question after spending an entire day wrestling with this incredibly frustrating feature of the Windows 10 command prompt which made me think there was something wrong with my console application code. I hope it will help…
Shaun Rowan
  • 9,269
  • 4
  • 28
  • 52
170
votes
20 answers

Server is already running in Rails

When I am starting rails server using rails s command it is showing A server is already running. Check C:/Sites/folder/Pids/Server.pids When I open the file it is outputting a 4 digit number only so how could I resolve this issue ? FYI No other…
swapnesh
  • 26,318
  • 22
  • 94
  • 126
165
votes
6 answers

Have bash script answer interactive prompts

Is it possible to have a bash script automatically handle prompts that would normally be presented to the user with default actions? Currently I am using a bash script to call an in-house tool that will display prompts to the user (prompting for…
TJ L
  • 23,914
  • 7
  • 59
  • 77
161
votes
12 answers

How to include jar files with java file and compile in command prompt

I have 3 jar files and a .java file that depends on these jar files. How do I compile the .java file with these jar files using a command prompt?
user1177567
  • 1,663
  • 2
  • 12
  • 9
148
votes
3 answers

How to run an application as "run as administrator" from the command prompt?

I have a batch file called test.bat. I am calling the below instructions in the test.bat file: start /min powershell.exe %sysdrive%\testScripts\testscript1.ps1 When I run this through the command prompt, my testscript is running successfully. I…
Praveen Jakkaraju
  • 1,601
  • 4
  • 16
  • 13
142
votes
17 answers

How to start jenkins on different port rather than 8080 using command prompt in Windows?

I have jenkins.war and I started it from command prompt in Windows as: java -jar jenkins.war It was started well and easily browsed as http://localhost:8080 I want to start on 9090 port. How can I do that?
user2027659
138
votes
17 answers

javac not working in windows command prompt

I'm trying to use javac with the windows command prompt, but it's not working. After adding the directory "C:\Program Files\Java\jdk1.6.0_16\bin\" to the end of the PATH environment variable, the java command works fine, but using javac gives me the…
Dom M.
  • 3,762
  • 8
  • 32
  • 40
131
votes
5 answers

How to change current working directory using a batch file

I need some help in writing a batch file. I have a path stored in a variable root as follows: set root=D:\Work\Root Then I am changing my working directory to this root as follows: cd %root% When I execute this batch file from anywhere on the D…
Ananya
  • 1,503
  • 3
  • 12
  • 8
120
votes
9 answers

Start/Stop and Restart Jenkins service on Windows

I have downloaded "jenkins-1.501.zip" from http://jenkins-ci.org/content/thank-you-downloading-windows-installer . I have extracted zip file and installed Jenkins on Windows 7 successfully. Jenkins runs at http://localhost:8080/ well. I want to…
user2027659
119
votes
8 answers

How to zip a file using cmd line?

I want to zip a directory using the batch file command (Windows XP batch file). For example, if I want to unzip a file means I can use the jar -xf file.zip(java) bat file command. Like that I want a command line batch to zip a directory.
PS Kumar
  • 2,096
  • 6
  • 30
  • 45
106
votes
19 answers

Can I mask an input text in a bat file?

I am writing a batch file to execute some other programs. In this case I need to prompt for a password. Do I have any way to mask the input text? I don't need to print ******* characters instead of input characters. Linux's Password prompt behavior…
Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
102
votes
8 answers

Run a Command Prompt command from Desktop Shortcut

Is it possible to create a desktop shortcut that, when pressed, will open command prompt and run a pre-defined command?
Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225
100
votes
12 answers

How can I display my current git branch name in my PowerShell prompt?

Basically I'm after this but for PowerShell instead of bash. I use git on windows through PowerShell. If possible, I'd like my current branch name to displayed as part of the command prompt.
Paul Batum
  • 8,165
  • 5
  • 40
  • 45
94
votes
5 answers

Running command line commands within Ruby script

Is there a way to run command line commands through Ruby? I'm trying to create a small little Ruby program that would dial out and receive/send through command line programs like 'screen', 'rcsz', etc. It would be great if I could tie all this in…
geetfun
  • 1,138
  • 1
  • 8
  • 8