cmd

capturing CMD batch file parameter list; write to file for later processing

I have written a batch file that is launched as a post processing utility by a program. The batch file reads ~24 parameters supplied by the calling program, stores them into variables, and then writes them to various text files. Since the max input variable in CMD is %9, it's necessary to use the 'shift' command to repeatedly read and ...

bmail to send mail to an exchange server

Hello, I want to run bmail from the command prompt to send a mail.I am using exchange sever 2003 as as the mail server,when ever i enter the script it tells me that socket closed.Plz can any one help.. ...

Psexec , cmd and batch file

Hello. I have a batch file named a.bat on a winserver2008 Desktop. That batch file only write the SessionID (from environment variable) to a local eventlog. I want to execute it remotely using cmd (otherwise the SessionName doesn't appear). so I have tried c:\PsTools\psexec.exe \\<Server> -u test2 -p <Password> -i 2 cmd "c:\Users\te...

system() to c# without calling cmd.exe

how to translate system("") to C# without calling cmd.exe? edit: i need to throw something like "dir" ...

How to log the output from cmd tree command using Apache Ant exec task?

Hi, I am trying to log the output from cmd tree command using ant with the following: <exec dir="${basedir}" executable="cmd" output="output.txt"> <arg value="tree" /> </exec> However, I am seeing the following in the "output.txt": Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp...

Save gcc compile status to a text file for Java

I'm making a C Assessment Program through Java, which has a bunch of programming questions for C, and it lets the user input an answer in the form of C code, and then press a "Compile" button, which is linked to a bat file that runs the user input code through gcc. I've got the input and compiling working, but I need to get the output f...

continue execution after running some .bat script

example buil.bat script start /B webdev.webserver.exe /port:3234 /path:C:\projects\src\XYZWeb /VPATH:/XYZWeb when program run this script also execution stop. How to continue execution after running this script. Problem is that build.bat never end and you must manually close it. i look here http://ss64.com/nt/start.html but no comman...

Executing bat file and returning the prompt

I have a problem with cruisecontrol where an ant scripts executes a bat file that doesn't give me the prompt back. As a result, the project in cruisecontrol keeps on bulding forever until I restart cruisecontrol. How can I resolve this? It's a startup.bat from wowza (Streaming Server) that I'm executing: @echo off call setenv.bat if ...

Windows batch file: Pipe destroys my return code

Hi, is it possible to return the errorlevel also if I pipe the output of a script into a logfile: test1.bat: call test2.bat 2>&1 | tee log.txt echo ERRORLEVEL: %ERRORLEVEL% test2.bat: exit /B 1 Output when calling test1.bat: ERRORLEVEL: 0 The errorlevel is always 0. The problem is, I want to call another script inside my ...

Help with CVS in command line after an already "checked out" module by a GUI app.

I've already checked out a bunch of repositories in my ~/cvs folder, using CrossVC, a graphical CVS client. How can I use CVS in cmd with these already checked out repositories? Which variables should I export? (I have 10 directories, which one with different checked ou repositories) ...

CVS in cmd/gui works only the third time I run a command.

I'm using CVS in the command line. I'm in my repository folder. When I call a CVS command, I get... cvs [log aborted]: unrecognized auth response from localhost: -f [pserver aborted]: /opt/cvs/XXXXXX: no such repository ...2 times. The third time I run the command, it works with no problems. I tried to use a GUI client (CrossVC) and t...

exit /B 0 does not work...

Hi, I have the following problem: I have created a batch script which calls itself in there (for being able to write a log in parallel). In the script I start another process (like start startServer.bat) which starts up a java process and keeps opened up all the time. In my original script I wait 30 seconds, check if the process is r...

How to run a packaged java file

Can anyone help me on how I have to run a java application which is in a package, from cmd? Please give me the necessay line that I have to type Thank You EDIT: (Copied a clarifying comment from one of the answers below) No i mean a normal java aplication that belongs to a package, like package x; class SampleOnly{ } how you comp...

Make CMD sensitive to use with MySQL?

I have a cleanup scrip in a bat file and i wanted to do the below but the problem is i get a mysql error saying unknown database and showing it as testdb. I guess i can change my code testdb but i would like to know. How do i have windows cmd use case sensitivity so i can execute queries properly instead of always in lower case? mysql....

How to define virtual IP programmatically?

Hi! I need to define Virtual IP programmatically (Perl or VB or CMD or java). I need it for temporary use, I can't use any actual IP address and I don't care if it will be accessible only from local machine. Any help will be appreciated. Thanks, Yan ...

php is not recognized as an intern command (using windows)

Hello, I want to develop using a framework called symfony BUT, i do not have a MAC and i don't want to dual boot with Debian. I tryed virtual hosts via Virtual Box but it's too crappy. So i decided to stay on windows So when the tutorial tells me to do php lib/vendor/symfony/data/bin/check_configuration.php i do in the windows cmd...

How to get path from a variable

Following http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd I want to strip the path (without the filename) from a variable. following the logic of the methods discussed above I would like to use batch bellow, which doesn't work. any takers? possible? set cpp="C:\temp\lib.dll" echo %cpp% "C:\temp...

How to enable IIS server functions on windows from your C# Programm (or just using BAT file)?

How to enable IIS server functions on windows from your C# Programm (or just using BAT file)? ...

Opening console applications in powershell

Hi, I'm currently developing a win32 console application, and wondering if there is any way to make visual studio open it in powershell instead of cmd.exe when I'm debugging it. All I really want is a better shell, where I can copy/paste etc. without clicking. Thanks ...

Gracefully trap error on start cmd

On a cmd prompt or bat file, I issue the following: start textpad myfile.txt and it works fine. If the program textpad does not exist on the computer, then an error sound and a popup occurs which the OK button must be pushed. I desire to trap this error so that I could do something like start textpad myfile.txt || start notepad myf...