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
1 answer

batch file to open multiple command prompts and execute the same task

I want a batch script which opens up multiple command prompt on a single click and runs the same command over and over again . i have written a below code which only opens an single command prompt and stops there .is there a way to do the same. …
Santhosh Pai
  • 2,535
  • 8
  • 28
  • 49
6
votes
2 answers

How to pause cmd before it close?

This is my code System.Diagnostics.ProcessStartInfo proc = new System.Diagnostics.ProcessStartInfo(); proc.FileName = @"cmd.exe"; proc.Arguments = "/C "+ "ipconfig" ; System.Diagnostics.Process.Start(proc); when I run this code , Cmd run and shut…
Goondude
  • 101
  • 1
  • 3
  • 10
6
votes
6 answers

Changing Pause Message

Ok, so you know how when you type up pause in CMD, it will say 'Press any key to continue...'. How do I change that to say something like 'Press a key to proceed...'? Lastly, I was coding a batch file. I want to know what's up if I have something…
user2507295
  • 159
  • 1
  • 2
  • 6
6
votes
2 answers

How to input special character in cmd?

I have written a c program that retrieves arguments from the command line under Windows. One of the arguments is a regular expression. So I need to retrieve special characters such as "( , .", etc., but cmd.exe treats "(" as a special character. How…
Jichao
  • 40,341
  • 47
  • 125
  • 198
6
votes
2 answers

Find and Replace inside for loop [batch script]

The below code works, echo test.test set replaceWith=. set str="test\test" call set str=%%str:\=%replaceWith%%% echo %str% But, the below code echo ggg.hhhhh all the 4 times. SET SERVICE_LIST=(aaa\bbb ccc\dddd eeee\fffff ggg\hhhhh) for %%i in…
sElanthiraiyan
  • 6,000
  • 1
  • 31
  • 38
6
votes
3 answers

Timeout for user decision in windows batch file

I wrote a simple .bat file that asks the user a yes/ no question at one point. Now I want to add a timeout - lets say 10s - to it. Is there an easy way to do it? My source so far: SET /P ANSWER=Do you want it (Y/N)? IF /i {%ANSWER%}=={y} GOTO…
terman
  • 303
  • 4
  • 12
6
votes
3 answers

Getting Screen Names

I have come across an issue when it comes to loading up a user-friendly setting for a game. What I am trying to do: I am trying to load the name of all the monitors in a distinguishable manner. What I have…
user1181445
6
votes
9 answers

How do I make Perl scripts recognize command-line parameters in the Win32 cmd console?

When I invoke my Perl scripts in the Windows environment without invoking perl first, the parameters are not passed to my script. For example, C:\> C:\my-perl-scripts\foo.pl bar invokes foo.pl but doesn't recognize bar as a parameter (@ARGV is…
Keith Bentrup
  • 11,834
  • 7
  • 49
  • 56
6
votes
2 answers

How do I set an environment variable to a value with spaces in a batch file?

I don't know how to describe exactly what I'm trying to do but here's an example batch file that demonstrates what I can't figure out.: I've got a batch file. Inside that batch file I'm trying to create a directory: Set CopyFrom = %~dp0 if Exist…
BobTheBuilder
  • 2,455
  • 2
  • 27
  • 39
6
votes
4 answers

Keep open a cmd window

I have a python code in a program that opens a cmd window and runs there another program. The code looks like: os.chdir('C:/Abaqus_JOBS' + JobDir) os.system('abaqus job=' + JobName + '-3_run_rel2 user=FalseworkNmm41s interactive') Now everything…
jpcgandre
  • 1,487
  • 5
  • 31
  • 55
6
votes
5 answers

Running CMD as administrator with an argument from C#

I want to run cmd.exe as administrator with arguments from C# in order to prevent a UAC popup. This is necessary in order to use it as an automated installation process. The command I am passing in is simply a path to installation file (.exe) with…
Eric Kim
  • 10,617
  • 4
  • 29
  • 31
6
votes
3 answers

Windows .bat file, %~$PATH:1 quotes issue

I have a which.bat on Windows 7, @echo off REM This bat searches a file in PATH list to see whether a file can be found. REM If found, it shows the file's full path. REM which.bat gcc.exe REM shows REM gcc.exe is found:…
Jimm Chen
  • 3,411
  • 3
  • 35
  • 59
6
votes
2 answers

Running java files without ugly command prompt box in the background

I made a java program with a GUI using eclipse so whenever I want to run it I run it there, but my friend wants to run it on his computer so I made a class-file using javac in command prompt and also made a batch-file to run the program. The problem…
6
votes
3 answers

windows command line multiple commands

I am opening 3 cmd windows in different colours to help me distinguish between servers etc. These commands are in a .bat file. start cmd /k color 4C start cmd /k color 5D start cmd /k color 2A What I need to do is have them open up at a specific…
Neil
  • 7,861
  • 4
  • 53
  • 74
6
votes
1 answer

Pipes in Delphi for Command Prompt

How can I get Delphi to pass a string to the input pipe to a CMD process. I am able to get an error pipe and output pipe functioning properly, unfortunately not the input pipe. The code I am using is taken from an online tutorial for piping. There…
James_Hill
  • 167
  • 1
  • 4
  • 13
1 2 3
99
100