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
4 answers

Escape string for Process.Start

How can I escape an unknown string for passing to Process.Start as an argument? I currently escape basic quotes and backslashes, but recently my input has started to contain things like http://www.fileformat.info/info/unicode/char/ff02/index.htm…
thelsdj
  • 9,034
  • 10
  • 45
  • 58
6
votes
5 answers

Unrar an archive in C#

I want to silent extract of .rar archive. .Net haven't any Rar classes in IO.Compression, so i'd like to use cmd (it's better, than external dll). It extracts, but not in silent mode. What am I doing wrong? const string source = "D:\\22.rar"; string…
Alex Zhukovskiy
  • 9,565
  • 11
  • 75
  • 151
6
votes
2 answers

CMD / Batch / Registry - String replace not working as expected?

I'm having the most fun trying to replace a substring in one line of code for a windows registry key [HKEY_CLASSES_ROOT\PING\shell\open\command] @="C:\\Windows\\System32\\ping.exe %1 -t" Scenario and Context: The context is a custom url protocol…
StrikeForceZero
  • 2,379
  • 1
  • 25
  • 36
6
votes
1 answer

Robocopy invalid parameter #3

Here is my batch content Robocopy.exe D:\IDRIVE\New backups\Program\full\1 D:\IDRIVE\New backups\Program\full\2 pause But in cmd it's showing ------------------------------------------------------------------------------- ROBOCOPY :: …
Vishnu Murali
  • 75
  • 1
  • 2
  • 7
6
votes
2 answers

Git on cmd windows

I want to run Git commands directly on windows CMD, I downloaded Git from here http://msysgit.github.io/ but it has its own terminal called "Git Bash.vbs" and it consider the installation directory as the root. Any answers even 'No you can't run it…
sazz
  • 3,193
  • 3
  • 23
  • 33
6
votes
3 answers

How do I write the value of a variable to a dos text file?

How do I write a variable value to a text file within a dos batch script? (Y, JJJ, SERL, and SERIAL are variables in the batch file) I tried the following: set SERIAL=%Y%+%JJJ%+%SERL% %SERIAL% > VAR_1.TXT %T% > VAR_2.TXT %A% > VAR_3.TXT %SERL% >…
FITZ
  • 63
  • 1
  • 1
  • 4
6
votes
4 answers

load config file (project.properties) at runtime via command prompt in java

I would like to load properties file via command prompt in java. Properties file name: project.properties java -classpath .;test.jar; com.project.Main What 'll be the command if I'll load the properties files via command prompt. Thank in advance. I…
deepaksharma
  • 281
  • 3
  • 6
  • 12
6
votes
2 answers

windows cmd: problems with for /f with a quoted command with quoted parameters

for /f "delims=" %%a in ('"%systemRoot%\system32\find.exe" /?') do @echo %%a Yes, the previous line works. Not much useful but works. But trying write a batch file to answer another question, i faced something like for /f %%a in…
MC ND
  • 69,615
  • 8
  • 84
  • 126
6
votes
2 answers

How many JVM instances will create when we issue java command in different command prompts?

Can anyone please tell me how many jvm instances will created when we issue the following commands in different commands. - command 1: c:\java -Xms32m -Xmx512m -Xss254k AccountSalary - command 2: d:\java -Xms32m -Xmx512m -Xss254k AccountSalary -…
6
votes
3 answers

CMD Variable name restrictions?

What restrictions are there on batch file variable names, and why? I noticed that I am not able to echo a variable with the name :). h:\uprof>set :)=123 h:\uprof>set :) :)=123 h:\uprof>echo %:)% %:)% From a batch file obviously :) is outputted…
unclemeat
  • 5,029
  • 5
  • 28
  • 52
6
votes
1 answer

Command to list all available commands in Windows Command Prompt

I’d like to programmatically get a list of all the available commands in Windows Command Prompt (cmd.exe). Is there something like compgen -c in Bash, but for Windows?
Mathias Bynens
  • 144,855
  • 52
  • 216
  • 248
6
votes
4 answers

How do I capture command-line text that is not sent to stdout?

I am using the LAME command line mp3 encoder in a project. I want to be able to see what version someone is using. if I just execute LAME.exe with no paramaters i get, for example: C:\LAME>LAME.exe LAME 32-bits version 3.98.2…
Dave
  • 97
  • 5
6
votes
1 answer

Strange characters in php cli output

Some strange character are outputted at the beginning of some php console commands. Running composer the output is ok, but laravel artisan or phpunit outputs ´╗┐. I've tried to encode artisan and phpunit files to UTF-8 without BOM like suggested in…
gmsantos
  • 1,412
  • 22
  • 30
6
votes
2 answers

How to DIRECTLY execute command in txt file in cmd?

I have a question. How can I execute command in a plain text file? I know it seems crazy and I can simply rename it as a .bat file BUT it is important for me. Without renaming it, can i execute it in CMD? I know I can simply do this : ren…
Jamie
  • 1,096
  • 2
  • 19
  • 38
6
votes
4 answers

Is it possible to echo some non-printable characters in batch/cmd?

motivation I have a 3rd party, somehow long .bat file written for some specific function and would take considerable effort to re-write (which effort is also hindered by my problem). In for loops the most basic way to debug it would seem echoing…
n611x007
  • 8,952
  • 8
  • 59
  • 102