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.

0
votes
1answer
626 views

How to re-save web.config using command prompt

I'm using a simple cmd batch file to deploy my Asp.net MVC web application to server network share. The problem I'm having is that my DLLs can't be simply replaced by new files since existing ones ...
0
votes
3answers
1k views

copy link only in command window (Windows command prompt)

I would like to copy a file as a linmk to a diffferent directory is it possible in the command window to do that?
224
votes
13answers
508k 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?
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 ...
1
vote
4answers
6k views

How to set the arithmetic precision in “set” batch files variables?

How do I set a precision to the SET arithmetic operation on divisions? eg. SET /A t=3/4 But that gives result as '0' and not '0.75' ( I want at least 2 decimal places ) Or is there any other ...
3
votes
0answers
3k views

command line remove read only flag on all subfolder entries or overwrite read only files with robocopy

I need one of two things to work: I use robocopy to copy all sub-files and sub-folders from one folder to another, and the destination contains older files + files not in the source, and I need the ...
1
vote
1answer
7k views

Prompt for credentials in a batch script

I am trying to perform a network copy of files via a batch script. However, as usual there are some networks where the 'copy' command fails saying 'Bad username or password'. And when I try using ...
2
votes
4answers
1k views

Bat: Run a command in several folders

I have a project folder with a great number of projects inside. Is there a way I can create a bat file which goes into each of these project folders and runs a couple of commands? What I would like ...
1
vote
1answer
1k views

Starting Multiple Internet Explorers in a Batch File

In Windows XP, I am trying to start multiple IE7 with a batch file like this: @echo on "c:\windows\explorer.exe" "c:\windows\explorer.exe" "c:\Program Files\Internet Explorer\iexplore.exe" "c:\...
4
votes
2answers
20k views

How can I make the computer beep from a script/program called by the Windows task scheduler?

I am using Windows 7 home edition. I want to make my computer wait a certain amount of time, then beep in warning right before it terminates a program. As a test, I wrote the following batch file to ...
6
votes
1answer
11k views

How to copy files inside several folders into another directory

I have 6 CDs with PDF files inside a lot of folders (Like Prep1, Prep2... and so on.) I need to copy all the PDF files inside folders to my C:\ and then burn them all. Is there a command in cmd ...
2
votes
1answer
558 views

'copy' always leaves a blank line at the end of a file. Why?

When I use the DOS Copy command to copy multiple files into one file the result always has an extra blank line (cursor return line feed) at the end. How do I avoid creating this blank line?
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 ...
1
vote
2answers
6k views

Delete all files and folders EXCEPT those with extension .svn and .svn-base

I need to remove all files and folders from a particular parent folder except those which have .svn as the foldername and those which have *.svn-base as their filename. Is there a Windows script that ...
3
votes
4answers
29k views

Is it possible to copy a set of files, but automatically skip if file already exists? [duplicate]

I know that the copy command has an option to automatically replace a file if it already exists, but I want to know if it is a way to copy the files only if they not already exist (/Y). I do not know ...
1
vote
1answer
226 views

marking text in Windows 7's command prompt

I use Windows 7's command prompt (cmd.exe) for various tasks. In order to copy text from it, I right click and choose Mark, and then mark the text I want to copy. Sometimes while doing this, the ...
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
1answer
4k views

specify the sort order in “copy /b *.dat foo” in Windows cmd

Normally, when I do a copy /b *.data foo in Windows cmd, the *.data files are catenated in the sorted order into the destination file foo. This matches my desired behavior. However, I just met a ...
0
votes
1answer
192 views

How do I copy files from the command prompt?

I need to copy a file from one directory to another and at the same time, change the file extension. How do I do this?
1
vote
2answers
11k views

How do I use Command line to open and print or just print multiple pdf files?

I have a folder with quite a few pdf reports in it that I would like to setup to print automatically using the Task Scheduler in Windows and command lines to open adobe, the specific files, and then ...
10
votes
4answers
22k views

Finding multiple file extensions in command prompt window

I am trying to use multiple parameters to find 3 different extensions in my windows/system32 in one command: .exe, .dll and .sys This is giving me what I want, but I can't figure out how to get all 3 ...
1
vote
1answer
1k views

Repeat DOS command for each of three variables?

I need to write a batch file that repeats the same command (that takes a parameter) for each of three variable values already defined in the batch file. I want to loop over the variable values. I'm ...
0
votes
1answer
505 views

Windows 7 - Open Command Prompt Window

The CMD function is supposed to open a new command prompt window, however in Windows 7, it opens another inside of the existing one so if you typed in exit, it will simple exit the most recent one ...
1
vote
1answer
2k views

How to make a new file on Windows in CMD?

I need a .cmd file that creates a new type of file when I click it. Is this possible? For example: Click .cmd file CMD pops up asking what file do I want to create...(eg: .css, .html) Then creates ...
5
votes
3answers
33k views

Using backslash to escape characters in cmd.exe (runas command as example)

I see that the caret is the documented escape character. But, I have an example showing that for the double quote character, ^ doesn't work and you have to use \ C:\>runas /user:Administrator "...
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]?
2
votes
1answer
7k views

Using Windows cmd.exe and a batch .cmd, can I copy/xcopy/??? a Unicode filename from x:\* to y:\*

I want to do a very simple thing: Copy a file. Copy is a simple (and fundamental) command. It should be easy, but it seems to be complicated when it comes to Unicode filenames (using English XP, cmd....
4
votes
1answer
11k views

Changing the default command-line shell in Windows

Suppose I (or any running process) wanted to launch a shell in Windows (7) and issue a command, there are a number of options available. For example, one could: Bring up the start menu, type cmd, and ...
0
votes
3answers
1k views

print directory using command prompt

Found this one: http://www.watchingthenet.com/how-to-print-a-directory-tree-from-windows-explorer.html But I don't know how do I do it and save the directory listing somewhere. What I want to do is ...
2
votes
2answers
18k views

copy file to multiple folders via batch script

I want to copy a file (file.txt) inside all folders of a given destination. I want to create a batch file that does the job, but I'm not so skilled in Windows batch syntax.
1
vote
2answers
1k views

Keep cmd open after invokation of a cli application with Autohotkey

How can one keep the cmd window open after an invokation a cli application with Autohotkey? I need to see the program's output, but it exits and causes the window to vanish.
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: ...
1
vote
1answer
2k views

Copy images using a single dos command

I'm wondering if it's possible to copy only images files from a directory. For example, if source directory has: a.jpg b.gif c.png d.txt I want to copy only the images using one command, to get ...
6
votes
2answers
7k views

Windows Batch Scripting: Newest File Matching a Pattern

This would be lightning quick in linux, but I'm not familiar enough with windows flavour of batch scripting. Basically I want to look for a series of files matching a certain wildcard, and get the ...
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 ...
1
vote
1answer
738 views

How to distinguish folders from files in a batch script? (Or how to copy & rename-timestamp them indiscriminately?)

I want to create a batch file to copy files or folders in a specified directory and append the date and time to their names. Here's my actual code: @echo off Set _bpath=T:\Backup\ if [%1]==[] goto :...
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?
1
vote
1answer
1k views

How to check return status of command invoked from command line in windows?

reg import RegFile.reg How to check return code of this command ?
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 ...
4
votes
6answers
875 views

How can I get the “dir” and “copy” commands to operate on “*.xyz” but not “*.xyz~”?

When I use copy *.txt somefolder\ the system seems to copy all *.txt~ files too, which is not what I want. A similar same effect can be seen with dir: C:\Users\Paul\Documents\Programs\Proffy>dir *...
2
votes
2answers
2k views

How to include path of all files when doing a directory listing

(In Windows/Command line) I'd like to generate a list of all files, and for each file, I also want the full path displayed. So if you were doing a directory listing of the folder c:\users\me and it ...
1
vote
2answers
806 views

How to copy XP service log file during reboot or shutdown using command prompt?

Anybody know of a quick way of copying a log file used by a Windows XP service either before the service starts (during boot) or after the service has stopped (during shutdown)? Preferably using the ...
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 ...