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.

Filter by
Sorted by
Tagged with
1351 votes
28 answers
3.6m views

How do I remove the process currently using a port on localhost in Windows? [closed]

How can I remove the current process/application which is already assigned to a port? For example: localhost:8080
KavinduWije's user avatar
  • 41.4k
662 votes
27 answers
2.0m views

Error "'git' is not recognized as an internal or external command"

I have an installation of Git for Windows, but when I try to use the git command in Command Prompt, I get the following error: 'git' is not recognized as an internal or external command, operable ...
Jason Kim's user avatar
  • 18.6k
539 votes
14 answers
972k views

Command prompt won't change directory to another drive

I'm trying to compile some java (learning java currently), and to do so I need to change command-prompt's directory. C:\...\Admin> cd D:\Docs\Java C:\...\Admin> cd C:\...\Admin It doesn't ...
nebuch's user avatar
  • 6,775
538 votes
24 answers
600k views

Aliases in Windows command prompt

I have added notepad++.exe to my Path in environment variables. Now in command prompt, notepad++.exe filename.txt opens the filename.txt. But I want to do just np filename.txt to open the file. I ...
Romonov's user avatar
  • 8,365
458 votes
24 answers
439k views

xcopy file, rename, suppress "Does xxx specify a file name..." message

This seems pretty simple and maybe I'm just overlooking the proper flag, but how would I, in one command, copy a file from one directory to another and rename it in the destination directory? Here's ...
Sarah Vessels's user avatar
405 votes
21 answers
997k views

Install a Windows service using a Windows command prompt?

I want to install a Windows service using a Windows command prompt (not the Visual Studio command prompt). How do I do this?
Vikash Pandey's user avatar
373 votes
13 answers
426k views

What is the alternative for ~ (user's home directory) on Windows command prompt?

I'm trying to use the command prompt to move some files, I am used to the linux terminal where I use ~ to specify the my home directory I've looked everywhere but I couldn't seem to find it for ...
fenerlitk's user avatar
  • 5,624
362 votes
18 answers
1.6m views

Command line for looking at specific port

Is there a way to examine the status of a specific port from the Windows command line? I know I can use netstat to examine all ports but netstat is slow and looking at a specific port probably isn't.
user1580018's user avatar
  • 3,629
346 votes
20 answers
1.4m views

How to grant permission to users for a directory using command line in Windows?

How can I grant permissions to a user on a directory (Read, Write, Modify) using the Windows command line?
Amitabh's user avatar
  • 60.1k
296 votes
6 answers
1.4m views

javac is not recognized as an internal or external command, operable program or batch file [closed]

I am experiencing an error while trying to compile Java programs. I am on Windows (this is a Windows-specific problem) and I have the latest JDK installed. I have attempted a solution involving the ...
user987137's user avatar
  • 2,977
289 votes
7 answers
226k views

How to write a multiline command?

How do we extend a command to the next line? Basically what's the Windows alternative for Linux's: ls -l \ /usr/ Here we use backslashes to extend the command onto the next lines. What's the ...
Jigar's user avatar
  • 9,141
263 votes
12 answers
462k views

Using the "start" command with parameters passed to the started program

I have a Virtual Machine in Virtual PC 2007. To start it from the desktop, I have the following command in a batch file: "c:\program files\Microsoft Virtual PC\Virtual PC.exe" -pc "MY-PC" -launch ...
JosephStyons's user avatar
250 votes
8 answers
1.0m views

how to change directory using Windows command line

I'm using cmd.exe (C:\WINDOWS\System32\cmd.exe) and I have to change my current directory to "D:\temp" i.e. temp folder in the D drive. When I try to cd nothing happens. C:\> cd D:\temp C:\> ...
A. K.'s user avatar
  • 36.2k
248 votes
7 answers
257k views

Change all files and folders permissions of a directory to 644/755

How would I change all files to 644 and all folders to 755 using chmod from the linux command prompt? (Terminal)
hugo der hungrige's user avatar
230 votes
3 answers
684k views

How to add a set path only for that batch file executing?

Basically, I know I can go through my control panel and modify the path variable. But, I'm wondering if there is a way to through batch programming have a temporary path included? That way it is only ...
michael's user avatar
  • 15.1k
214 votes
17 answers
367k views

Compiling/Executing a C# Source File in Command Prompt

How do you compile and execute a .cs file from a command-prompt window?
Saj's user avatar
  • 18.5k
206 votes
6 answers
98k views

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 ...
Shaun Rowan's user avatar
  • 9,369
172 votes
21 answers
197k views

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 ...
swapnesh's user avatar
  • 26.6k
169 votes
6 answers
248k views

Have bash script answer interactive prompts [duplicate]

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 ...
TJ L's user avatar
  • 24.2k
166 votes
12 answers
418k views

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's user avatar
  • 1,713
149 votes
3 answers
897k views

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

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 ...
Praveen Jakkaraju's user avatar
146 votes
18 answers
287k views

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 ...
user avatar
138 votes
17 answers
619k views

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 ...
Dom M.'s user avatar
  • 3,779
133 votes
5 answers
401k views

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 ...
Ananya's user avatar
  • 1,523
132 votes
8 answers
535k views

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 ...
PS Kumar's user avatar
  • 2,266
121 votes
10 answers
459k views

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 ...
user avatar
109 votes
8 answers
365k views

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's user avatar
108 votes
19 answers
255k views

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 ...
Chathuranga Chandrasekara's user avatar
105 votes
12 answers
75k views

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's user avatar
  • 8,275
96 votes
5 answers
100k views

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....
geetfun's user avatar
  • 1,158
94 votes
4 answers
193k views

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 ...
Hamman Samuel's user avatar
91 votes
9 answers
329k views

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's user avatar
  • 2,926
89 votes
3 answers
4k views

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 ...
Justine Krejcha's user avatar
85 votes
3 answers
356k views

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 ...
user3505712's user avatar
81 votes
16 answers
111k views

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's user avatar
  • 24.7k
80 votes
24 answers
229k views

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 ...
aung's user avatar
  • 803
79 votes
10 answers
265k views

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 ...
user1473784's user avatar
76 votes
14 answers
296k views

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 ...
Matt Elhotiby's user avatar
73 votes
12 answers
469k views

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 ...
user avatar
71 votes
6 answers
30k views

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 ...
aksanoble's user avatar
  • 2,540
69 votes
4 answers
214k views

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 ...
Chandan Kumar's user avatar
69 votes
6 answers
104k views

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 ...
kentcdodds's user avatar
  • 28.1k
68 votes
7 answers
135k views

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 helpful http://answers.microsoft.com/en-us/windows/forum/windows_7-performance/how-to-schedule-...
Rajkiran's user avatar
  • 16.1k
68 votes
9 answers
400k views

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's user avatar
  • 1,929
67 votes
19 answers
171k views

Starting Visual Studio from a command prompt

I have three different versions of Visual Studio installed on my machine, Visual Studio 2003, Visual Studio 2008, and VS2005. How do I start a particular version of Visual Studio using a command ...
SNA's user avatar
  • 7,648
67 votes
6 answers
34k views

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 ...
kevin's user avatar
  • 3,078
62 votes
5 answers
84k views

Having trouble escaping quotes and braces

I am trying to execute the following line in Command Prompt: curl -X POST -d '{ "method" : "account_info", "params" : [ { "account" : "...
killajoule's user avatar
  • 3,772
61 votes
7 answers
128k views

nuget is not a recognized as an internal or external command

While running a batch file, I get the below error: nuget is not a recognized as an internal or external command It's not working from command prompt. Have a look at the below screenshot.
Varun Maggo's user avatar
  • 1,264
61 votes
9 answers
329k views

How do I run a program from command prompt as a different user and as an admin [closed]

I am using "runas" to open command prompt as a different user but that command prompt is not running as an admin. How can I make it run as an admin? UPDATE: I am using Windows Server 2012 UPDATE: ...
Mark's user avatar
  • 891
61 votes
6 answers
104k views

What do the three arrow (">>>") signs mean?

I haven't been able to figure out what the >>> does, even though I often see it often in source code.
Dumle29's user avatar
  • 829

1
2 3 4 5
85