batch

Send commands to other command-line programs

Hey, Is there a way, to send commands to another command-line program? 'Cause i have a special command-line program, but I can't send commands to it using syntax like program.exe something_to_do the program executes something like this: ("here syntax" is where i want to input text to and also enter to start) TheWhateverCommandLinePro...

BATCH Windows: 30 minutes.

Hello, I want to do something: i have a LARGE batch file, but this is what i want to apply to HOLE the batch: After 30 Minutes, it should display a message. How is this possible, and can i set this to the hole batch. I kinda have a lot of stuff in it. ...

How can I check the size of a file in a Windows batch script?

I want to have a batch file which checks what the filesize is of a file. If it is bigger than %somany% kbytes, it should redirect with GOTO to somewhere else. Example: [check for filesize] IF %file% [filesize thing Bigger than] GOTO No echo Great! Your filesize is smaller than %somany% kbytes. pause exit :no echo Um... You have a big ...

How expand a CMD shell variable twice (recursively)

Using the Windows XP CMD command-line I can expand a variable twice as follows: set AAA=BBB set BBB=CCC for /F "usebackq tokens=*" %i in (`echo %%AAA%%`) do echo %i will echo CCC. I.e. AAA has been expanded to the string BBB, and then the variable BBB has been expanded to CCC. This doesn't work from inside a batch script (i.e. a .cmd...

how to delete every n-th char in file (via batch or vbs)?

Hello, how can I delete every n-th (4000th) char (space character) in a file (.txt or .sql) best via batch or vbs? Thanks in advance! ...

filesize and linelength limits for windows batch files

Hey, I am generating a Windows batch file that might become quite large, say a few megabytes. I've searched on possible limits regarding the maximum file size and maximum length of a line in a batch file but couldn't find anything. Any practical experiences? ...

How do I keep DOS batch echo on for parent script?

I have a DOS batch file that I want echoing turned on. However, this DOS batch file calls other batch files that then turn echoing off. I don't mind that the child batch files turn echoing off for themselves. But, is there any way for them not to affect the main script's echoing? ...

batch files help

i need help making a batch file in ms dos to do certain commands like a)Request from you to first press any key b) List the contents of the C:\WINDOWS directory c) Create a subdirectory on one of your local drives. Use your initials to name the subdirectory. d) Copy all the text files from C:\WINDOWS directory into the new subdirecto...

Stick Images together

I just tried to use Google Map Buddy to get satellite image from Google Map. This application first download small images from google map and then stick them together into new image. I had to wait about 2 hours to get images download my computer and it looks like it downloaded all images (22,194 images) but then the app told me that it c...

Drag and drop batch file for multiple files?

I wrote a batch file to use PngCrush to optimize a .png image when I drag and drop it onto the batch file. In the what's next section, I wrote about what I thought would be a good upgrade to the batch file. My question is: is it possible to create a batch file like I did in the post, but capable of optimizing multiple images at once? D...

convert batch files to exes

I'm wondering if it's possible to convert batch files to executables using C++? I have plenty of batch files here and I would like to convert them to executables (mainly to obfuscate the code). I understand that there are 3rd party tools that can do this but I was thinking that this would be a good opportunity for a programming project. ...

Check for existance of all files before building a project

How would one go best about checking for existance of all files before building ? Let me explain; I mostly build stuff from the command prompt. No problems there, just put the build command and all in the one .bat /.cmd file, and run it. It works fine. But, for the normal running of my program, for example, I need several source files...

Suppress command line output

I have a simple batch file like this: echo off taskkill /im "test.exe" /f > nul pause If "test.exe" is not running, I get this message: ERROR: The process "test.exe" not found. Why does this error message get displayed, even though I have redirected output to NUL? How can I suppress that output? ...

Batch output redirection when using start command for GUI app

This is the scenario: We have a Python script that starts a Windows batch file and redirects its output to a file. Afterwards it reads the file and then tries to delete it: os.system(C:\batch.bat >C:\temp.txt 2>&1) os.remove(C:\temp.txt) In the batch.bat we start a Windows GUI programm like this: start c:\the_programm.exe Thats al...

Windows Batch Search and Replace Question

I have a small batch file to search and replace within a batch file. I am having difficulty removing things (eg replacing some text with a null value). Am sure it is simple but not found anything by searching! This is the file: Where you see xxxxx and yyyyy is where I need a blank! Cheers. @echo off setlocal enabledelayedexpansion ...

Creating a batch file to do drag and drop files onto an exe

I have an exe that I can drag and drop another file onto to produce a third file. Unfortunately it seems to accept only 1 file at a time, if I select multiple and drop it doesn't seem to work. How do I create a batch file to automate the process of dragging a thousand files of .drag extension onto drop.exe? Thanks! ...

Expect-like tool for windows

I am searching for a tool that behaves similarly to Unix's expect tool (or at least, its main function). I want to automate command-line interactive programs with it. EDIT: I am preferring single executables or small apps without big multi megabyte depencies. Ty. ...

Batch Script IF

I'm trial and erroring a trivial batch script: I need to execute the .bat and have it iterate through all the files in the current directory and delete all files (and subfolders) except for itself and two other files. This works: @echo off for /f %%f in ('dir /b c:\d\test') do (del %%f) This doesn't: @echo off for /f %%f in ('dir /...

When is faster to use batch operations on JDBC?

I have a piece of code that executes about 500,000 inserts on a database. It's now done in a loop calling PreparedStatement's executeUpdate at each iteration. Would it be faster to add all 500,000 inserts to a batch and and call executeBatch just once? ...

SubSonic 2.x Batch Query SQLite

Hi there, I'm writing a windows service that import an XML file into a SQLite database. There are 3,000 odd records that need to be created and i'm using SubSonic 2.2 for the project. Instead of looping through a list and adding them to the database one by one is there a way to batch query more than 1 new record at a time. I know the...