batch

MSBuild Validating Properties

I'm working on a reusable MSBuild Target that will be consumed by several other tasks. This target requires that several properties be defined. What's the best way to validate that properties are defined, throwing an Error if the are not? Two attempts that I almost like: <?xml version="1.0" encoding="utf-8" ?> <Project ToolsVersion="...

How to launch a web server and point the browser to it when it finishes?

I am writing a windows batch file to do the following things: Display a picture in the middle of the screen, showing the beautiful icon of my software. Kick of the launch of the web server. Finish displaying the picture. Point the browser to the start page. I have already know how to do it in step 2 and 4. However, I have the followi...

Stopping and Starting Apache Using PHP (!)

Hello all, I have two problems which are related. 1) I have a batch file that contains this: net stop wampapache net start wampapache Which tries to stop and start my wamp server. When I double click the stop.bat file with the above it works successfully. When I try to run that from my PHP script, it stops the server but doesn't sta...

Batch and the for loop

Hi everyone, I have a java application launched by a .cmd file. I want to set the classpath of the application through this batch, all the needed jars are into a lib folder. Here is what I tried : set _classpath=. for %%i in (%1/lib/*.*) do ( set _classpath=%_classpath%;%%i ) Surprisingly, it seems that it does not act as expected...

setting mvc wildcard fix in iis 5.1 through batch commands

http://www.ee99ee.com/blog/2009/02/08/how-to-get-aspnet-mvc-working-under-iis-51-on-windows-xp/ Can the following be put into batch commands? If not, is there an alternative where the configuration can be set through an executable without the user having to configure through IIS? ...

DOS Batch file include external file for variables

I have a DOS batch file and I want to include external file containing some variables(say configuration variables). Is it possible? ...

7zip timestamp archive under context menu

Does anyone know how I can add a context menu item that would compress a folder and add a timestamp? So that I can right-click a folder and it would give me the option to create something like this: folder_20100528.zip (I'm posting it here because I figure it's something that's done through a batch file/code) ...

Batch equivalent of Bash backticks

When working with Bash, I can put the output of one command into another command like so: my_command `echo Test` would be the same thing as my_command Test (Obviously, this is just a non-practical example.) I'm just wondering if you can do the same thing in Batch. ...

How to set PATH to another variable value with spaces in Windows batch file

I've got a Windows batch script issue that I'm bashing my head against (no pun intended). The problematic script looks like this: if defined _OLD_VIRTUAL_PATH ( set PATH=%_OLD_VIRTUAL_PATH% ) When I run it and _OLD_VIRTUAL_PATH is set I get: \Microsoft was unexpected at this time. _OLD_VIRTUAL_PATH is a variable that was origin...

cmd.exe: complex conditions?

in DOS batch files, In an IF statement, is it possible to combine two or more conditions using AND or OR ? I was not able to find any documentation for that Edit - help if and the MS docs say nothing about using more than one condition in an if. I guess a workaround for AND would be to do if COND1 ( if COND2 ( cmd ) ) but th...

Grails batch insertion

Hi, My requirement needs to insert thousands of records and when inserting each new record it was taking more time to finish the job. Could any one please suggest how to use batches in grails ? thanks in advance, sri ...

Is there a good way to execute MySQL statements atomically via JDBC?

Suppose I have a table that contains valid data. I would like to modify this data in some way, but I'd like to make sure that if any errors occur with the modification, the table isn't changed and the method returns something to that effect. For instance, (this is kind of a dumb example, but it illustrates the point so bear with me) sup...

XSLT For Breaking Elements Into Sets?

Is XSLT a good solution for breaking an XML document into sets by element name? For example, if my document is: <mydocument> <items> <item>one</item> <item>two</item> <item>three</item> <item>four</item> </items> </mydocument> I want to split this into sets of 3 or less like: <mydocument> <items page="1"> <item>one</item> <item>two</...

Communication between parallel batch files

I have a batch file, 'buildAll.bat', that builds a set of projects. It will be called by another batch file, 'manager.bat'. The 'buildAll.bat' job executes in another window and outputs a lot of text. I want the progress of the build job to be displayed in the original window('manager.bat'), like this: Building project 1...done. Buildi...

Exporting a variable from a Windows batch file to Cygwin

I want to initialize my Cygwin environment with a variable coming from a batch file @set myvar=test %BASH% --login -c "set" REM hope to see myvar So I want myvar with its value eventually be available in bash. ...

Windows batch file to delete folders/subfolders using wildcards

I need to delete all folders in "tomin" folder, which name contains terminates with the ".delme" string. The deletion need to be done recurively: I mean on all directory and SUB directories. I though to do this: FOR /R tomin %%X IN (*.delme) DO (RD /S /Q "%%X") but it does not work, I think /R ignores wildcards. Before asking this q...

How can i access to sql server from windows batch

Hi there, I want to connect to Sql server and running some sql queries. How can i do that? Thank you for helps.. ...

How to debug MinGW32-make batch files?

I'm having some difficulties building up some cross-platform Makefiles, and I'm getting errors from processes called by mingw32-make that don't make the problem clear. I've tried calling mingw32-make with "-d", and I get a lot of debug output, but the actual program invocations are hidden in temporary batch files that are immediately del...

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...