cmd.exe

Why do some cmd launched processes block/buffer output when the output is redirected?

Why do some processes started at the command line on my Windows machine block/buffer their entire output if it is redirected and others not? Example: tracert does not block/buffer output as it is written. If one executes: tracert ponyoverflow.com > output.txt ...the output.txt file grows over time. This is completely how I would ...

The system cannot find the file specified when running CMD.exe from C#

I'm getting the error message when running the following code from a C# console program. "The system cannot find the file specified" Here is the code: System.Diagnostics.Process.Start("C:\Windows\System32\cmd.exe /c"); Strangely when i omit the /c switch the command can run!?! Any ideas what I'm doing wrong? ...

Can I specify the files to commit in subversion in a file rather than on the command line?

I have renamed (with svn move) a lot of files in a subversion project. Now, I am trying to commit these on Window's cmd.exe. It seems that I hit a limit (probably by cmd.exe) in that the number of files is too long for the command line to swallow. Now, I thought and hoped that I could list the files to commit in a seperate file that I c...

run windows command from bash with output to standard out?

Folks, I'm using git tools such as git bisect run which need to call a command to build and test my project. My command to do is nant which is a windows program. Or a build.cmd script which calls nant. It's easy to get the bash to call the nant build to run. But the hard part is how to get the standard output written to a file? I eve...

control cmd.exe with c# (send and read outputs)

I want to send and receive commands like "dir" and so on but i can't manage to read the output ...

What is wrong with this recursive Windows CMD script? It won't do Ackermann properly

I'm trying to get to calculate the Ackermann function. A description of what I'm trying to achieve is at http://rosettacode.org/wiki/Ackermann_function. Using the test script, Test 0 4 gives me 5 which is correct. However Test 1 4 gives 5 not 6, and Test 2 4 gives 5 instead of 11. Where am I going wrong? ::echo off set depth=0 :ack i...

Windows batch file to list folders that have a specific file in them

I'm trying to create a file that has a list of directories that have a specific file name in them. Let's say I'm trying to find directories that have a file named *.joe in them. I initially tried just a simple dir /ad *.joe > dir_list.txt , but it searches the directory names for *.joe, so no go. Then I concluded that a for loop wa...

How to do proper Unicode and ANSI output redirection on cmd.exe?

If you are doing automation on windows and you are redirecting the output of different commands (internal cmd.exe or external, you'll discover that your log files contains combined Unicode and ANSI output (meaning that they are invalid and will not load well in viewers/editors). Is it is possible to make cmd.exe work with UTF-8? This qu...

How to hide cmd.exe console?

I put this below code inside my *.dll for Internet Explorer. FILE *child = _popen("java -jar c:\\simmetrics.jar c:\\chtml.txt c:\\thtml.txt > c:\\output.txt", "r"); fclose(child); My problem is, when I run my Internet Explorer, the will be a cmd.exe console open too. I don't want the console to suddenly appear when I run my browser....

What is the maximum length of a Window's command-line (cmd.exe) command?

There are many people asking questions on SO about how to get around the cmd.exe command maximum length. I was wondering what actually is the Windows command-line length limit? Is it different between version of Windows? Does using a 32-bit vs. a 64-bit version affect this limitation? ...

CMD.exe quoting a string.

What's the exact way to properly quote a single command line argument? For example, I have some random text in a variable $X. I need to quote it in a way so that if I call system("program.exe " + $X_QUOTED); then argv[1] of my program.exe has to match original unquoted $X imagine I have this program.exe: int main(const char **argv, ...

Can I make the download dialog box appear without "save" option?

I have a hyperlink to an executable like so: <a href="xxx.exe"> Run Now </a> I'm trying to make the download dialog box appear without the save function as it is to only run only on the user's computer. Is there any way to manipulate the file download dialog box? FYI: Running on Windows Server '03' - IIS. Please no suggestions for a W...

Is it possible to set an environment variable to the output of a command in cmd.exe

I need to do the equivalent of set ENVAR=`some-command` In a windows/cmd.exe script. Cygwin is not an option. For bonus marks: Is there some cmd.exe equivalent of backticks in general? ...

tf.exe Unable to detrmine the workspace

Hi all, I am trying to call TF get command via Tem Build script. I am getting the following error Unable to determine the workspace. Folks over the internet tell that this error is because Team Build cannot find the workspace because it is being called from a directory which is not part of the workspace. The solution presented is ...

Why does GIT not use the core.editor and commit.template configuration values when running from the bash command prompt?

When I run commit from a standard command prompt it is opening the configured editor defined by the core.editor configuration value and uses the template defined by commit.template. However when I run commit from the bash command prompt it is ignoring these settings and opening the VI editor without the template. Why is this? I am n...

windows command promt zip/compress directory

Is possible to compress/archive a directory with all of its sub-directories and files in a single file from cmd.exe ? I know there are a lot of utilities available but I need to perform the operation only with the windows default utilities . I'm running windows server 2003 . ...

i want to know about the code of .exe file which is in command prompt

I have a problem of to open(EXTRACT) a command prompt. I want to see the code inside this "a*.exe" file. can u suggest me as if i am not aware of this field(software). how to extract cmd.exe file. ...

Running JVM inside Windows C console app becomes zombie if debugging is stopped in the middle

I wrote a C program that starts a JVM using JNI_CreateJavaVM. The program is a Windows console application (VC 2008). JNI version is 1.6. If I debug the program and then stop the debugging in the middle, before it reaches the call to DestroyJavaVM then the CMD.exe window remains open and I'm unable to close or kill it. If I look at the ...

Creating a simple finger application with batch

I would like to make a simple batch application that does two things. Asks the user to input a name, example "vega" Runs "finger [email protected]" and displays the output of that command. The following does the first thing, but I am not able to output the result from the finger. @ECHO OFF :begin echo Enter the name of the ...

Hudson cmd.exe running as

Where does hudson CI get user to run the cmd.exe ? I'm trying to start and stop some remote services on various slaves and special credentials that are different than what hudson is using are needed. I can't find a place to override the user. I've tried running the server as various users, but it doesn't change anything. Any other ideas?...