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
1288
votes
28 answers

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

How can I remove the current process/application which is already assigned to a port? For example: localhost:8080
KavinduWije
  • 39,451
  • 4
  • 14
  • 17
637
votes
23 answers

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 program or batch file. How do I fix this problem?
Jason Kim
  • 18,102
  • 13
  • 66
  • 105
519
votes
20 answers

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 tried using DOSKEY np=notepad++. But it is just…
Romonov
  • 8,145
  • 14
  • 43
  • 55
516
votes
14 answers

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 change the directory. I try again using…
nebuch
  • 6,475
  • 4
  • 20
  • 39
455
votes
23 answers

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 my command: if exist…
Sarah Vessels
  • 30,930
  • 33
  • 155
  • 222
396
votes
21 answers

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
  • 4,037
  • 3
  • 16
  • 8
354
votes
13 answers

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 windows command prompt (Documents and Settings\[user])
fenerlitk
  • 5,414
  • 9
  • 29
  • 39
350
votes
18 answers

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
  • 3,509
  • 3
  • 14
  • 3
342
votes
20 answers

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
  • 59,111
  • 42
  • 110
  • 159
294
votes
6 answers

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

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 PATH variable, but the error persists. Console…
user987137
  • 2,957
  • 3
  • 14
  • 3
276
votes
7 answers

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 equivalent for Windows?
Jigar
  • 8,762
  • 6
  • 25
  • 26
257
votes
12 answers

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 But that leaves a dos prompt on the host machine…
JosephStyons
  • 57,317
  • 63
  • 160
  • 234
239
votes
8 answers

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:\> I don't know what else to do here. Even pressing tab key…
A. K.
  • 34,395
  • 15
  • 52
  • 89
238
votes
7 answers

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
  • 12,382
  • 9
  • 57
  • 84
225
votes
3 answers

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 used during that batch file execution. I don't…
michael
  • 14,844
  • 28
  • 89
  • 177
1
2 3
99 100