Questions tagged [cmd]

Command Prompt (executable name cmd.exe) is the Microsoft supplied command line interpreter on OS/2, Windows CE, and all Microsoft Windows operating systems. Use this tag for questions regarding programming scripts or on commands available to run from the Command Prompt. Add tags for which version of Windows, and tags describing the task or issue.

Command Prompt (executable name cmd.exe) is the Microsoft-supplied command-line interpreter on Windows NT-based operating systems (including Windows 2000, XP, Vista, 7, 8, 10, Server 2003, Server 2008, Server 2012 and Server 2016), OS/2 and Windows CE. It is the analog of COMMAND.COM in MS-DOS and Windows 9x (where it is called MS-DOS Prompt) systems, or of the Unix shells used on Unix-like systems.

Include additional tags to identify the version of Windows such as , , , etc.

Resources:

See also:

26386 questions
244
votes
41 answers

NPM stuck giving the same error EISDIR: Illegal operation on a directory, read at error (native)

I am stuck with this error no matter what directory I am in, and what I type after "npm" in cmd.exe. Here is the npm-debug.log: 0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Program…
AnotherMike
  • 2,633
  • 2
  • 16
  • 15
241
votes
1 answer

How to list files in windows using command prompt (cmd). I've tried using ' ls ' as in Linux but it shows an error?

When I tried to use list ls on a Windows command prompt, the system doesn't recognize it. I already added C:\Windows\System32 in the path.
Abdullah
  • 2,531
  • 3
  • 13
  • 15
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
236
votes
9 answers

Running NPM scripts sequentially

Let's say I have "scripts": { "pre-build": "echo \"Welcome\" && exit 1", "build_logic": "start cmd.exe @cmd /k \"yo esri-appbuilder-js:widget && exit 1\"", "post_build": "start C:\\WebAppBuilderForArcGIS\\startupShortcut", "exit" :…
Rice
  • 3,371
  • 4
  • 19
  • 23
225
votes
7 answers

Setting a system environment variable from a Windows batch file?

Is it possible to set a environment variable at the system level from a command prompt in Windows 7 (or even XP for that matter). I am running from an elevated command prompt. When I use the set command (set name=value), the environment variable…
Santhosh
  • 6,547
  • 15
  • 56
  • 63
224
votes
14 answers

Why git can't remember my passphrase under Windows

I have just start using git and i can't get it to remember my passphrase I'm using cmd.exe elevated and my git host is github and i have create a ssh key like that guide on github but i still get *\subnus.mvc>git push origin master Enter…
Nesizer
  • 3,074
  • 6
  • 22
  • 25
216
votes
6 answers

Why does only the first line of this Windows batch file execute but all three lines execute in a command shell?

I have a batch file that executes three Maven commands, one after the other. Each command can be successfully executed in the script - by itself!. But when I add all three commands to the same file, only the first one executes before the script…
wiki
  • 3,379
  • 3
  • 20
  • 13
216
votes
3 answers

How to verify if a file exists in a batch file?

I have to create a .BAT file that does this: If C:\myprogram\sync\data.handler exists, exit; If C:\myprogram\html\data.sql does not exist, exit; In C:\myprogram\sync\ delete all files and folders except (test, test3 and test2) Copy…
cusspvz
  • 5,143
  • 7
  • 30
  • 45
214
votes
7 answers

Running Windows batch file commands asynchronously

Say, if I have foo.exe bar.exe baz.exe How do I run all of them from a batch file asynchronously, i.e. without waiting for the previous program to stop?
RichN
  • 6,181
  • 3
  • 30
  • 38
209
votes
8 answers

What are the undocumented features and limitations of the Windows FINDSTR command?

The Windows FINDSTR command is horribly documented. There is very basic command line help available through FINDSTR /?, or HELP FINDSTR, but it is woefully inadequate. There is a wee bit more documentation online at…
dbenham
  • 127,446
  • 28
  • 251
  • 390
203
votes
5 answers

How to do a simple file search in cmd

I want to quickly search for a file given its name or part of its name, from the windows command line (not power shell). This is similar to opening explorer and using the search box at the top. Note: dir can search based on a string template but it…
Bogdan Gavril MSFT
  • 20,615
  • 10
  • 53
  • 74
195
votes
5 answers

Using parameters in batch files at Windows command line

In Windows, how do you access arguments passed when a batch file is run? For example, let's say I have a program named hello.bat. When I enter hello -a at a Windows command line, how do I let my program know that -a was passed in as an argument?
APerson
  • 8,140
  • 8
  • 35
  • 49
194
votes
8 answers

How to make PowerShell tab completion work like Bash

Let's say I have the following files in my current directory: buildBar.bat buildFoo.bat buildHouse.bat And I type the following at my command prompt, ./bu and then TAB. In Bash, it gets expanded to ./build In PowerShell, it gets expanded to…
RobSiklos
  • 8,348
  • 5
  • 47
  • 77
193
votes
16 answers

Is there any sed like utility for cmd.exe?

I want to programmatically edit file content using windows command line (cmd.exe). In *nix there is sed for this tasks. Are there any useful native equivalents (cmd or ps) in windows?
Jakub Šturc
  • 35,201
  • 25
  • 90
  • 110
188
votes
15 answers

Changing all files' extensions in a folder with one command on Windows

How can I use the Windows command line to change the extensions of thousands of files to *****.jpg?
Berker Yüceer
  • 7,026
  • 18
  • 68
  • 102