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.
4,230
questions
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
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 ...
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 ...
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 ...
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 ...
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?
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 ...
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.
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?
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 ...
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 ...
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
...
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:\>
...
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)
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 ...
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?
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 ...
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 ...
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 ...
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?
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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?
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 ...
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.
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....
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 ...
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.
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 ...
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 ...
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?
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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-...
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.
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 ...
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 ...
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" : "...
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.
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: ...
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.