Most voted "cmd" questions
Command Prompt (cmd.exe executable name) is the command line interpreter provided by Microsoft on OS/2, Windows CE, and Windows NT operating systems (including Windows 2000, XP, Vista, 7, Server 2003, and Server 2008).
Learn more…266 questions
Sort by count of
-
28
votes5
answers26646
viewsIs there a "sudo" for Windows?
Usually it is easy to open a program/script .bat with upgrade using the option "Run as Administrator" right-click. But what if I want to run something with elevation from the cmd, a kind of sudo,…
-
20
votes3
answers25651
viewsWhat is the equivalent of the grep command in Windows?
Under Linux, when I want to filter by a term when a command will generate giant list, I use the command grep. For example: ls | grep "termo" However, in Windows there is no command grep. What would…
-
13
votes4
answers3721
viewsList files by name (containing date), but filter the 5 days prior to the current date with . bat?
I’m trying to do something that maybe it’s not even possible to do in bat but specific using findstr? I have a dozen files in that layout: filename So, date as day and month content two digits and…
-
12
votes3
answers1382
viewsHow do I delete a file, which has quotes in the name, by CMD?
I am deleting a folder from my hard drive and could delete everything except that file. Because it has quotes, I can’t use short names, and I can’t erase it the way it is. I tried to fsutil file…
-
11
votes5
answers22737
viewsHow to turn the output of a command into a variable in CMD?
Hello, since I started researching about these commands of CMD, this doubt about how to turn the output of a command into a variable has been the one that took me the most time. I saw a lot of codes…
-
10
votes3
answers1471
viewsUse Command Line with C#
In my work I use the command line, and wanted to improve the work in my company. To do this, I thought of creating a program in C# for people who do not know how to work with command line. I thought…
-
10
votes3
answers685
viewsPrevent the CMD command interpreter from using the operators passed via parameter/argument?
There is a way to prevent operators present in past arguments, via command line, from being used/interpreted by the interpreter CMD in C, C++ or C#? I want to make use of characters present in the…
-
9
votes1
answer16141
viewsCMD, Powershell, Bash - What’s the difference?
There are differences between them, which? I’m talking about Ubuntu’s Bash. I’m curious because to me they seem to do the same thing!
-
8
votes5
answers51063
viewsCommand "npm" is not recognized by Command Prompt
I have a project with a package.json, in it I have everything configured. I just cloned that same project on another machine, man git clone worked smoothly. But when I give the command npm install…
-
8
votes1
answer9291
viewsExecute cmd commands from Java
I wonder how I do to execute cmd commands in java. Well, I did that: import java.io.*; public class Commands { static final Runtime run = Runtime.getRuntime(); static Process pro; static…
-
8
votes2
answers22304
viewsHow to hide command output in CMD?
I have a file .bat and in it is the command: chcp 65001 Which results in output on CMD: Página de código ativa: 65001 But I want this message, displayed after the command is executed, to be hidden…
-
7
votes1
answer13295
viewsSend file directly to printer via CMD
Does anyone know how I can send a txt file (with EPL commands) manually directly to printer by cmd?
-
7
votes2
answers8059
viewsRun Windows Prompt commands and save the output in a text file
I have a program that launches a command of Prompt windows. I want to copy the output of this command and save to a text file. Example: The command is ipconfig and I want the output to be copied to…
-
6
votes1
answer604
viewsRun Fullscreen program on Windows 7
Hello I have a project already finished, it was written in C language as I do so that it runs in fullscreen in windows 7? Do you have a library for this? I’ve been looking on the internet but I…
-
6
votes2
answers833
viewsShow use of Processor
I am trying to show the use of the server processor with PHP. Server is Windows with IIS. I’ve tried to use : exec("wmic /node:localhost path Win32_Processor where DeviceID='CPU0' get…
-
6
votes2
answers849
viewsWhat is the difference between SET and SETX?
To fix a new environment variable in Windows I checked that there are commands SET and SETX. What is the exact difference between the two commands?
-
6
votes3
answers2223
viewsHow to delete files from a recursively expression-based folder?
I’m using a project where there are several temporary files that, for some reason, have not been deleted over time and that are taking up a lot of space. I need to delete all images from this…
-
6
votes3
answers342
viewsHow to escape characters in Windows Batch?
I have the following script: start "" "https://site.com.br/app/index.jsf?username=nomecabuloso&token=tokenzera" But when I do, it’s only index.jsf, it opens the following url:…
-
6
votes1
answer1028
viewsWhat are the differences between . bat and . cmd?
We rarely see file .cmd, but when opening it, we see that its content is very close to a .bat. What is the reason for this similarity ? What would be the main differences between them ?…
-
6
votes1
answer604
viewsIdentify JDK version from Java
I am creating an IDE and when the user presses to run the code I do the following: try { File file = new File(arquivoSelecionado.nome); try { FileWriter fw = new FileWriter(file);…
-
6
votes3
answers230
viewsCode shortcut for multiple git commands
How do I have only one command run another automatically on git? Example: When sending git atalho perform the following instructions: git status git add Post.txt git commit -m "aqui coloco uma…
-
5
votes1
answer713
viewsCMD, Console, MS-DOS and related terms
Well, you have embarrassed all the concepts that I’m going to list below, and I would like to present the definition of these terms, maybe some are synonymous with others and others are totally…
-
5
votes1
answer552
viewsCMD WINDOWS commands
I don’t know if you can ask questions about this subject, but I’m having difficulties to open the file continuously on Windows CMD. When I use Linux just do this: tail -f…
-
5
votes2
answers761
views -
5
votes2
answers6054
viewsWindows CMD - Setar String with Accentuation
I am trying to create a Batch (CMD) in Windows that "sweeps" folders in a particular directory and then renames the sub-folders according to a criterion I set. I am using the code below to carry out…
-
5
votes1
answer812
viewsHow to send special characters from CMD to a file?
I want to send the character > to a file via CMD but I’m not getting. The following example illustrates my difficulty: echo casa > cidade > Estado >Arquivo.txt In the above example you…
-
5
votes1
answer1828
viewsHow to present the correct accent on the return of cmd?
Considering a method to list files from a folder using ProcessBuilder I have the incorrect return of the accented words. Code import java.io.BufferedReader; import java.io.IOException; import…
-
5
votes4
answers10576
viewsTo create a folder named after the current date in Windows cmd.exe
What I already have: %date% is the windows variable that stores the current date. When I use echo %date% the value Tue 07/25/2017 is correctly printed. But when I try to do mkdir %date% the created…
-
5
votes2
answers3041
viewsInclude task in Windows task scheduler via batch
I do the configuration of several types of backups per batch, the codes are not pertinent to this question, but what it takes is always configure them by the Windows Task Scheduler. There are some…
-
5
votes1
answer5532
viewsIn a file . bat (Batch) how to rename a file using variables such as %userprofile%?
I am wanting to rename a file that is found on the Desktop using batch script. The only line that’s going wrong is this: rename "%userprofile%\Desktop\Lista.xlsb" "%userprofile%\Desktop\Lista -…
-
5
votes1
answer2738
viewsHow to make a python file execute commands in cmd?
For example: netsh wlan show profile This command of cmd shows the wifi networks already connected, at least once to my notebook! How can I run this command using python 3?…
-
5
votes2
answers291
viewsCmd text box functionality for Git
I’m developing a .bat, which will make a series of commands from the git predefined. But one of these commands, it is necessary that the user type an operation message. Follow the series of…
-
4
votes2
answers2696
viewsHow to run a subprocess with admin permission?
I’m making a script that accesses the cmd windows, via subprocess. Only I need to rotate the cmd as an administrator. The solution I found, does not satisfy me, which would be to use the runas. What…
-
4
votes2
answers211
viewsDisplays hexadecimal value in cmd.exe
I’m trying to show the sharp letter 'is' on cmd.exe through the hexadecimal, but the printf() only shows the value of the character itself. I’m trying the following: unsigned char eh = 0x82;…
-
4
votes1
answer663
viewsProblems installing the Ionic Framework
I am beginner with the framework Ionic and I’m having a problem trying to do the installation. Recently I had to format my computer and now I am not able to install the framework again. When I run…
-
4
votes1
answer1552
viewsCreate database via existing command line and overwrite
I have a Function (Delphi) that creates processes and executes BAT files that make, for example, backup a Mysql BD, like this: "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe" -u root…
-
4
votes2
answers501
viewsOpen an executable file using VB or CMD
How to open a file from any extension, such as - Paçoca.legalcara an executable like - algo.exe using CMD or VB? Note: The path must be relative, which means that all are in the same folder…
-
4
votes1
answer1912
viewsCompile multiple Java classes in cmd?
How to compile multiple files .class in java by cmd? I tried and he informs that it was not possible to locate the main.
-
4
votes1
answer91
viewsHow to create an endless process?
Simple question, how do I make my application process to be "unstoppable" by the system? I want when a user tries to close the application to appear the message "Access denied", and when it forces…
-
4
votes1
answer297
viewsSend commands to a Batch with user input
Context: I have a Batch I can’t change, its function is to list some files in a specific directory, and after it lists the files it is waiting for some user command. Problem: I would like to…
-
4
votes2
answers3435
viewsCompile multiple java files in the same folder
I made a very simple Java program, using the notepad and compiling by CMD. The problem is that even though the files are in the same folder, the class that has the method main() does not compile.…
-
4
votes1
answer496
viewsAddress and UDP destination ports do not appear
I’m creating in PHP a page that tracks UDP packet traffic from my machine. My intention was to get the list so: ____________________________________________________________________________ | Proto |…
-
4
votes1
answer1323
viewsWhat is Delayedexpansion and why is it not enabled by default?
Usually when creating a batch that uses any code block, such as loops for or if, we ended up going through this problem and then we discovered the need to set EnableDelayedExpansion. Codes like this…
-
4
votes1
answer6483
viewsWhat is the most appropriate way to batch test ERRORLEVEL?
I’ve seen several forms of testing ERRORLEVEL in batch scripts. Some of them are dangerous and others are wrong, but sometimes go unnoticed. Below are some examples I know: Dangerous: the test works…
-
4
votes3
answers1204
viewsCreate bat to move files returned by findstr
Good afternoon to all! I have come across a daily problem where, I have several . xml to open and check if these have tags: < desc_produto >Riscos< /desc_Produto >" or <…
-
4
votes1
answer937
viewsRunning cmd commands or scripts from java does not work
I’m having trouble running some commands through java. Whether I run them directly from Netbeans or run the project directly from my machine works perfectly any of the following commands: String…
-
4
votes3
answers1929
viewsOperations with dates (delete file with date in name and earlier than 6 months) without using Forfiles
It’s been a long time since I’ve dealt with VBS, so I thought I’d just do it on the command line I need to delete files earlier than 6 months from the current date, as the files I am managing have…
-
4
votes2
answers1253
viewsC program executing commands in cmd
I am wanting to create a C executable that opens the prompt and execute commands through it, the executable is a solution to the problem "ethernet does not have a valid ip configuration". I’ve even…
-
4
votes1
answer1017
viewsCreate File Name with Day of the Week
I need to create a routine that does the backup with the name of day of week in order to comply with the following layout: Example: backup_01012019_second.7z The closest you could find that didn’t…
-
4
votes2
answers6606
viewsAutomatic installation script without user interaction
I need to run the ocsinventory agent installation automatically via script, which will be started by the domain’s GPO, and can be in . bat, . vbs or powershell, and there can be no user interaction.…