batch-file

How to Instantiate/Run a Ruby program (uses Watir) using Linux?

Scenario : I mapped a network drive on a Win XP machine and I double click a .bat file to execute this Ruby script. The .rb and .bat file reside on this networked drive. The batch file is as follows : Z: cd Z:\ABC\StatusCheck\ "C:\Program Files\Ruby\Bin\ruby.exe" Z:\ABC\StatusCheck\rubyScript.rb 6 The Ruby file is as follows : requ...

Creating a shortcut for a exe using a batch file

I know a topic already exists like that but I do not want to use a VB script. I would hope you can create a shortcut using a command line in DOS. Please post some example that would be great. Thanks! AA ...

Windows batch file: get folders' path and store them in variable

Hello I need a batch file to store in a variable all paths of all directories/subdierectories named ".svn" that I can found in my_folder. Something like: @ECHO OFF FOR /r my_folder %%X IN (.svn) DO (ECHO %%X) the command above prints them to screen, but I need to store them in a variable as a list of strings. Someone knows how to do ...

Windows batch file: call more than one command FOR each loop

Is it possible in batch file to call more than one command in a single FOR loop, let's say for example I want to print the file name and after delete it. @ECHO OFF FOR /r %%X IN (*.txt) DO (ECHO %%X DEL %%X) REM the line above is invalid sintax. I know in this case I could solve it by doing two distinct FOR loops: one for showing the ...

Permanent line at the bottom of the console window in batch files

Hi guys, Just wondering if anyone knew if it was possible to have a permament line of text at the bottom of a cmd prompt window when running a batch file? So it floats, and if there is a lot of text flowing on the screen, and the cmd prompt starts to scroll, that line of text is still there at the bottom. Cheers, Tim ...

how to backup mysql database in vb.net

Is it possible through the use of a batch file, I'm trying this code: mysqldump --host=localhost --user=root --password=nitoryolai -R hospital >E:\wamp\etc\db-backup\hosp.sql Then vb.net will execute the batch file through s.d.p.s("b.bat") But it doesn't work, it only creates an empty .sql file. Can you tell me what's wrong with the b...

programming batch file

How can I programmed batch file at windows xp that it will perform combination of keys? for example: win+L to switch user or other combinations. ...

What are "%1" and "%2" in batch files?

What does the following %1 means (in a .bat file)? jsmin <%1 >%2 ...

How do I create a batch file that will search all subdirectories for filetypes and copy them to a folder?

This is what I have: for /R %i in (*.swf) do copy %i C:/testfolder/ I get the error "The system cannot find the file specified. It's finding the .swf's just fine, but it's not copying them. ...

Windows batch assign output of a program to a variable

I need to assign the output of a program to a variable using a MS batch file. So in GNU Bash shell I would use VAR=$(application arg0 arg1). I need a similar behavior in Windows using a batch file. Something like set VAR=application arg0 arg1. Thanks! ...

How to set a local variable to the result of sql query in a batch file?

Is there any way to retreive the result set of a sql query in a local variable; the query is to be run in a batch file. What I am trying to do is something like this: set varname = osql -S%dstserver% -d%dstDB% -Q"SELECT name from table_name where Id = %siteId%" %osqluser% -b varname is my local variable. I am quite new in sql so any ...

Displaying lines from text file in a batch file

File test.cmd: name=dummy for /f "eol=; tokens=1 delims=," %%i in (list.txt) do ( echo i: %%i set name=%%i echo name: %name%) the file list.txt contains this lines (one name per line): John Tom Erica Sara Each time I launch this batch I get this output: i: John name: dummy i:T om name: dummy i: E...

What's the syntax for .bat?

if "%OS%"=="Windows_NT" @setlocal ... if "%OS%"=="Windows_NT" @endlocal Does the above basically mean this: if(OS == 'Windows_NT'): ... endif I've curious what's setlocal for ? EDIT Now the only uncertain is:how do bat identify the endif? ...

How do I write a pidfile in a windows batch file

Hi! I am writing some Java code that needs to be able to write a pidfile on Unix-like as well as windows machines. On the unix machines I write out a bash shell script that contains something like this command 1>/dev/null 2>&1 & echo $! > pidfile It executes a command, redirects all output into nirwana and puts command into the backg...

My batch file works, but for some reason also returns file not found..

My batch file reads all of the files from a windows directory with the option to include sub directories or not include them, and then saves the list to a txt file. It woks perfectly, but for some reason the application returns "File Not Found" after you answers yes or no to the sub directories question (although the question does functi...

How to Execute complex batch command on the fly

I looking the way to run DOS/windows batch directly from C# code without saving it as .BAT file before. I'm mainly interested to run DOS command with combination of stdin stream. Let's say I need execute something like that: echo 'abcd' | programXXX.exe -arg1 --getArgsFromStdIn After that programXXX.exe will take 'abcd' string as -ar...

Batch file to launch VS2008 and compile a solution file

I have written the batch file below, in order to automate the process of launching Visual Studio 2008, and then building and compiling the solution file, so that instead of manually starting up VS2008 and then pressing F5, I can just run my solution file: START CMD.EXE cd C:\Program Files\MobileRobots\Aria\examples mbuild myProg.sln ...

How do I use ProcessStartInfo to run a batch file?

But it doesn't work -meaning the java code is not executed. Although the batch file runs fine when clicked in Windows explorer or when run in command line .. Since this works fine when the batch file is a single DOS command, I think this is somehow related to the fact that the Java code needs ~20 minutes to run. I'm using the following ...

Dynamically setting maximum heap size for java process

I have a Java program that is launched by a batch file with a line like this: javaw -Xms64m -Xmx1024m com.acme.MyProgram However, on some computers the program will not launch and displays the following message: Could not reserve enough space for object heap. Could not create the Java virtual machine. The problem seems to be t...

what could cause PUSHD to fail?

I've got a great big script that is entirely reliant on PUSHD. However suddenly when I type pushd \\server1\dir1 I'm getting: C:\Documents and Settings\userNameHere>pushd \\server1\dir1 ' ' CMD does not support UNC paths as current directories. OK, I'm aware that CMD doesn't support UNC paths. That's why I'm using PUSHD. When I search...