Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cmd.exe]

cmd.exe, or the Command Prompt, is the default command-line interpreter for many Microsoft-created operating systems.

5
votes
3answers
58k views

How would I use Takeown to take ownership of all folders on one drive?

I have a hard drive which I need to recover specific files from but all the folders in the K:\ drive are denying me access even though I took owner ship of the full drive I.E C:\Windows\System32>...
14
votes
3answers
17k views

Can I use the “start” command with spaces in the path?

I have a path like this: Y:\xxx\dd sss\aaa\ccc Y:\ is mapped to an FTP address. Now when I try to use start to open my folder I cannot. Command prompt makes mistake a and goes to Y:\xxx\dd folder! I ...
224
votes
13answers
507k views

Grep equivalent for Windows 7?

Is there a command prompt grep equivalent for Windows 7? That is, I want to filter out the results of a command: Bash use: ls | grep root What would it be from a Windows command prompt?
6
votes
6answers
7k views

Windows 10 default dpi settings make cmd blurry

I have recently upgraded to Windows 10 and I have noticed that my cmd console is very big and blurry. I have tried reducing text-size, but if I reduce those the desktop items become too small. The ...
2
votes
2answers
2k views

Please help me delete a file? [duplicate]

I have a movie named Con Man. Apparently, in Windows, you cannot have a file name with the name CON in it. Can anyone please help me delete it? It is stored in F:\Movies\Con Man The name of the file ...
17
votes
8answers
15k views

Easiest way to get right-click “Open command window here” with admin priveleges in Windows 7

I don't want to install PowerToys, I'd rather a simpler solution for this specific problem. I've tried Ctrl+Shift+Right-Click. I've tried adding a registry script, but I get the following error: ...
9
votes
7answers
37k views

Set Internet Explorer as the default browser from the command line

Is it possible to set Internet Explorer as the default browser to launch from the command line? I have a web application that only runs under Internet Explorer, but if it happens that Firefox is ...
3
votes
2answers
3k views

CMD Window Quickly Opens and Closes

I have noticed lately that in specific intervals, there is some program that is automatically running – I can tell that because a CMD window quickly opens and quits. It even minimizes games, which is ...
221
votes
7answers
506k views

How to recursively delete directory from command line in windows?

What is the windows equivalent of rm -r [directory-name]?
85
votes
9answers
31k views

How to open Windows CMD so that it starts in the current folder? [duplicate]

When I'm working in a folder in Windows Explorer, sometimes I have a need to run some CMD command in this folder. How do I open the command line from a current folder, so the console opens in the ...
77
votes
3answers
21k views

Is typing %^ into cmd.exe a Windows easter egg?

When I typed %^ in cmd and pressed Enter, and it said: More? When I pressed Enter again, it gave the same response. Is this an Easter Egg? What is this?
34
votes
3answers
77k views

How to copy a file to a directory in DOS, and create directories if necessary?

How can I copy a file using DOS commands into a directory structure that may not yet exist? I need to be able to force the creation of the directory path to the target file location if that location ...
6
votes
3answers
2k views

Why does “start winword” work but just “winword” doesn't?

Assume Microsoft Office is installed. Consider the following batch file: REM the following line successfully launches Microsoft Word start winword REM none of the following commands work to launch ...
5
votes
3answers
18k views

Move all files from multiple subfolders into the parent folder

I would normally open the parent folder and search for * in order to select all of the files in subfolders, but in this instance, I have over 1,000,000 files that I need to sort through, so my ...
5
votes
8answers
37k views

How to get LAN ip to a variable in a Windows batch file

I'm streaming audio from my Windows 7 laptop to a sound card attached to a router. I have a little batch script to start streaming. REM Kill any instances of vlc taskkill /im vlc.exe "c:\Program ...
2
votes
3answers
17k views

How to search and replace a string in multiple text files (within a directory) with Windows CMD? Part 2

This is in relation to this question . Unfortunately, PowerShell scripts are disabled on the system I am working on. I can't even use a simple (Get-Content). I did figure out how to do change ...
0
votes
2answers
3k views

Find path of standard executable for a given file type in Windows

Suppose I am running cmd and I open an application by typing for example start document.pdf I want to get the exact path of the executable that opens .pdf files Of course I could search the entire ...
69
votes
5answers
41k views

Turning off the cmd window beep sound

Is there a way to essentially mute the Beeping function of the Windows command shell? I'm working on a PowerShell script right now which ends up printing several lines of text to the screen. I'm ...
41
votes
1answer
6k views

Why does a file get opened when I write its name, without extensions, in the command line?

On Windows 10, I have a file called truffle.js in my current folder. I write truffle in the cmd window, expecting to invoke the truffle program which resides elsewhere on my path. Instead, truffle.js ...
6
votes
2answers
36k views

How to copy all files of a certain type into a folder from command prompt?

I want to copy all files of a certain type (like .docx, .pdf, etc) on my PC into a folder. How can I do that?
5
votes
3answers
18k views

How do you convert an SSH private key to a .ppk on the Windows command line?

I have generated a key pair with ssh-keygen. I now want to use the same key pair with PuTTY-based applications. Because I'm working in a CLI environment, I want to convert the key to the .ppk format ...
7
votes
4answers
56k views

How to find and delete multiple Windows registry entries?

I need to clean the Windows registry after manually removing a program. What I need to do is following. Find all keys, values, and data containing "something". Delete all keys, values, and data ...
7
votes
2answers
23k views

Copying only newer files from one folder to another

I have 2 folders with files. These files are the product of some build process. The first folder is the outputs of previous build while the latter is the output of the current build. I would like to ...
13
votes
0answers
3k views

Why doesn't windows command prompt still support ctrl + v? [closed]

This is just one of those things that I started wondering about. Why aren't the copy/paste keyboard shortcuts (that we all love) in command prompt not aligned with the rest of the software population?...
6
votes
2answers
8k views

In chkdsk, what is an online scan?

Running Windows 8.0 Pro, chkdsk has a /scan option that Runs a online scan on the volume (sic). What is an online scan? My guess is that it runs it while letting you use the drive, which is good if ...
4
votes
4answers
28k views

How to list open ports and application using them in windows?

I have trouble identifying the application using port 25 on my Windows-10 system. Any useful hints to list used ports and using applications without 3rd party applications ?
4
votes
2answers
481 views

Change command prompt to only show current directory name

I was fiddling around with the prompt commando in cmd and was wondering whether there was a way to show the path like C:\..\dir4 instead of C:\dir1\dir2\dir3\dir4. I have searched around, and I can ...
3
votes
1answer
4k views

How to run a python script with cmd.exe and make it invisible

How do I run an invisible cmd.exe command? Example: C:\Python27\tool.py and make it visible after a while? I tried some methods that I found on Google but I'm not very satisfied. I do not have ...
2
votes
3answers
9k views

How to generate MD5 hash value for multiple files in a folder using cmd

As mentioned in this page, the command:CertUtil -hashfile yourFileName MD5can be used to obtain the MD5 hash value for a particular file. How can I find the MD5 hash values for multiple files in a ...
2
votes
1answer
164 views

How do I move this batch choice description to a newline?

I have a batch script template that includes a choice in it, I want to have the question for what the end-user wants to do, and the choice description(s) below the question. Here is my template: @...
2
votes
1answer
387 views

How can i connect to ad-hoc network using CMD?

I'm trying to connect my computer (PC1) to an existing ad hoc using cmd commands.This ad hoc was created by second computer(PC2),i spend hours to find results but i did find an answers.See this photo ...
1
vote
2answers
1k views

Overwrite line in Windows batch file? [duplicate]

Just before I say anything, I have tried this code: @echo off setlocal enableextensions enabledelayedexpansion for /f %%a in ('copy /Z "%~dpf0" nul') do set "ASCII_13=%%a" set /p "=Example 1" <...
1
vote
2answers
108 views

Is there any way to prevent the current CMD input being erased by a blank history suggestion?

In the CMD interpreter on Windows, the Up (↑) arrow key replaces the current input (not sure what the accurate term is) with commands in the command history; commands that have previously been ...
1
vote
1answer
658 views

More than one 'Open xxxxx here as Administrator'

I want the option to open a Command window or Powershell window as Administrator from the drive and directory context menus in Windows. I can have either by creating and populating the special '...
0
votes
1answer
5k views

Move all files within subfolders to parent folder

Firstly, I'm aware there are tons of similar questions, and I know because I must have tried adapting at least 5 of them, but I'm still here asking because my crappy grasp of CMD (which I actually ...
0
votes
4answers
4k views

Windows command FOR /F isn't working?

I'm trying to use the FOR command in Windows XP's command line. I have a file temp.txt with 3 lines: temp1 temp2 temp3 And I'm typing the following command at the prompt: for /F %p in (temp.txt) do ...
3
votes
0answers
115 views

How I get my command prompt to show just the name of the folder I'm in (not the whole path))

In a command prompt window (terminal), how can I get my prompt to be just the current folder? e.g. prompt $p $g gives: C:\Users\Robin > But I want it to just show: Robin > UPDATE: As @...
3
votes
2answers
7k views

How to delete empty folders from a given directory in windows with a script

I'm using r.js as a build tool but as of today that tools doesn't give me the ability to delete empty folders in the build dir. I've found these two scripts for /f "usebackq" %%d in ("dir /ad/b/s | ...
2
votes
2answers
185 views

Delete a file that “does not exist” with a strange name

I've read about deleting files which "do not exist" and got as far as del /q /s filename in command prompt. However, the file is named COM^sv3.O[e in the browser. but when i type in dir it = Of ...
0
votes
1answer
55 views

Is it possible to run the Windows 10 Command prompt on Windows 7?

I'm running a Windows 7 Machine and wish to use it with my Windows 10 Batch file, however the colored text it uses does not support the Windows 7 Console (see https://stackoverflow.com/questions/...
0
votes
1answer
466 views

Create a folder.jpeg for videos from batch script

I want to be able to run a batch file and it looks in all the folders within directory and creates a folder.jpeg for each flv it finds in a folder. I have this script that works but it puts the ...
43
votes
6answers
146k views

netstat with process name?

Using netstat -a -o -n I can get the list of ports and PID then I need to go to task manager and add the PID and see who is it. (pretty frustrating) I was wonder if there is a CMD command which ...
14
votes
3answers
91k views

Open CMD as admin with Windows+R shortcut

My preference for running CMD is to use Windows+R » type cmd » Enter. But this doesn't open it with admin rights. Is there a way to type your way through to command prompt with admin rights?
9
votes
6answers
6k views

Create a batch file or shortcut to PuTTY (ssh) that opens a session and runs a command

I often find myself opening an SSH session to run the same single command. I have everything setup to login without entering a password (Via SSH Key-Based Auth), so I wondered if there was a way to ...
56
votes
2answers
85k views

Why is my localhost not 127.0.0.1 but ::1, and what notation is that? [duplicate]

When I use the Ping command against my localhost (on Windows Vista), it doesn't show up as 127.0.0.1. C:\Windows\system32>ping localhost Pinging GIGA [::1] from ::1 with 32 bytes of data: ...
25
votes
1answer
5k views

What is the difference between “shutdown /r” and “shutdown /g”?

I was reading some of the options for the shutdown command in windows, when I stumbled across the following option descriptions: /r Full shutdown and restart the computer. /g Full ...
7
votes
2answers
18k views

How to run a process in the background without keeping a batch file open?

I have a Windows service (the Bamboo integration server) that runs a batch file as a subprocess (a build job) of that script. Within that batch file I would like to be able to start a process (let's ...
21
votes
12answers
49k views

Play a sound (maybe WAV?) from Windows line command

How can i play a sound (CPU Beep or wav, don't matter what) using the Windows cmd?
15
votes
2answers
33k views

Switching default audio device with a batch file

I'm trying to write a batch file on Windows 10 that allows me to switch between my headset and my speakers as default audio device when I run it. I don't want to use any third-party software. I tried ...
13
votes
2answers
73k views

How can I list directories and their sizes in command prompt?

I would like to see sizes of subfolders in a folder, similar to linux du -sh command. How can I list directories and their sizes in command prompt?