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
6
votes
8 answers

running commands in cmd using C#

I want to run a cmd and run some command in it. I wrote this code: Process p = new Process(); ProcessStartInfo info =new ProcessStartInfo(); info.FileName = "cmd.exe"; info.WorkingDirectory = this.workingDirectory; info.RedirectStandardInput =…
mans
  • 17,104
  • 45
  • 172
  • 321
6
votes
4 answers

How to run Python from Windows cmd

I am trying to run a python program in Windows with a call like this: python pacman.py I have many such calls to the python program. I want to run it from windows command line. When I run this in Ubuntu it works well but when I try it in Windows, I…
user1210233
  • 2,730
  • 5
  • 24
  • 31
6
votes
1 answer

C# Embed Command Prompt in Form with locked position

I've been looking at how you can Embed a command prompt window into a WinForm. I have it working from many examples that use pinvoke but I want to be able to lock the command prompt window in a strict position within the form that the end_user is…
Derek
  • 8,300
  • 12
  • 56
  • 88
6
votes
1 answer

Installing Java with silent install into a directory with spaces

I am trying to install Java using the silent mode and also specify an installation directory that contains spaces. When I do this it pops up the "Windows Installer" dialog box indicating one of the parameters is incorrect. If I use the short path…
Gene S
  • 2,735
  • 3
  • 25
  • 35
6
votes
3 answers

How to do Binary comparison of files recursively within 2 folder paths using cmd?

I need to write a script for binary comparison of all files within 2 folders recursively. The 2 folders are installation folders and contain same files, but they are installation folders of different versions. I need to find which files (.dll, .lib,…
Kumar Vikramjeet
  • 253
  • 1
  • 4
  • 13
6
votes
1 answer

Mysterious Smiley turns up in my command prompt, it has me absolutely baffled, is my code leaking?

Lately, I have been just messing around in C++, just getting used to it, earlier today I was mucking about with arrays and when I compiled the program a mysterious smiley appeared, the array had no ASCII code inside it that was related to the…
otc
  • 431
  • 4
  • 15
6
votes
4 answers

Want to hide the cmd prompt screen

I have developed a utility which will get time of all servers in the list. System.Diagnostics.Process p; string server_name = ""; string[] output; p = new System.Diagnostics.Process(); p.StartInfo.FileName = "net"; p.StartInfo.UseShellExecute =…
Karthik Sampath
  • 101
  • 2
  • 7
6
votes
3 answers

How to prevent a bat file exiting early?

I'm running a maven plugin (this is just a new process) as part of a bat file.The plugin command causes the bat file to exit so the subsequent commands do not run. Is there a command or some other way to prevent the bat file quitting too soon ?…
user701254
  • 3,935
  • 7
  • 42
  • 53
6
votes
2 answers

Install An ODBC connection from cmd line

Install An ODBC connection from cmd line Hi, i want to install an odbc connection threw the cmd line, in this cmd below i can open only a name and driver of the database i want to use. i need to add also a ip,user,password,description. odbcconf…
Ofir Attia
  • 1,237
  • 4
  • 21
  • 39
6
votes
2 answers

Console output in cmd.exe, and powershell.exe through C++

I know a simple way for correct displaying of localized chars on Cmd.exe. But how can I do same for Powershell.exe? #include #include using namespace std; int main() { SetConsoleCP(GetACP()); …
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
6
votes
3 answers

Is there a scripting language that 'compiles' to windows batch syntax?

Is there a language, similar to what CoffeeScript is to JavaScript, that compiles to the language of the windows batch|cmd|command line? The cmd versions I refer to are the ones based on NT, especially XP sp3 and up.
n611x007
  • 8,952
  • 8
  • 59
  • 102
6
votes
4 answers

How to get integer of free disk space in Batch file?

I'm trying to get integer of free disk space in Batch file. This is a my (very) simple code. @echo off wmic logicaldisk get freespace >> freespace.log exit But output in freespace.log file. FreeSpace 9772687360 57401442304 7346626560 0…
nakorndev
  • 803
  • 2
  • 11
  • 18
6
votes
6 answers

.cmd and .bat file converting return code to an error message

I'm trying to automate a program I made with a test suite via a .cmd file. I can get the program that I ran's return code via %errorlevel%. My program has certain return codes for each type of error. For example: 1 - means failed for such and such…
Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636
6
votes
2 answers

Windows Batch: Search all files in file, if line contains "apple" or "tomato" echo it

I'm trying to write a simple batch that will loop through every line in a file and if the line contains "apples" or "tomato" then to output that line. I have this code to find one string and output it but I can't get the second in the same batch. I…
Jsn0605
  • 203
  • 3
  • 5
  • 13
6
votes
2 answers

Windows CMD - set within for loop is not working

I want to write batch file which will loop through all directories containing backup directory and remove files older than X days within it. On computer which I want run my script there's no "forfile" command. There's no PowerShell, so CMD or…
matandked
  • 1,527
  • 4
  • 26
  • 51
1 2 3
99
100