batch

SQL select groups of distinct items in prepared statement?

I have a batch job that I run on a table which I'm sure I could write as a prepared statement. Currently it's all in Java and no doubt less efficient than it could be. For a table like so: CREATE TABLE thing ( `tag` varchar, `document` varchar, `weight` float, ) I want to create a new table that contains the top N entries for ev...

What is the optimum number of sqls run in batch?

I am trying to load the data in Oracle server remotely. I am doing "executeBatch()" for every 50 sqls that are added in batch. (thru JDBC) What is the optimum number of sqls run in batch? Is it unlimited? ...

How to get entire svn commit message in window bat?

I need get the SVN commit message in post-commit hook bat in Windows, so I do this: FOR /F "tokens=*" %%a in ('"svnlook log %1 -r %2"') do @SET MSG=%%a I test it, it's ok for most case. but, when I input multiple lines in SVN commit message, the command can only get the last line of commit message, I think it's caused by the windows b...

How to stop a running *.JAR file with a batch script?

Hello everybody! We are facing trouble restarting closing a running *.JAR file started with the "java -cp". Killing java.exe worked fine. But... isn't there any smoother way for the application? (It saves data on shut-down) Also, how can one simulate any key input at the following message "Enter any key to continue..." with a batch ...

Can the Spring Framework be used for batch applications?

My company is switching to Spring for our Java framework, and from what I understand it will work well for that, but we also have many Java batch applications*. Does Spring have adequate support for running batch applications? What features of spring will be useful in this environment, and won't work at all? * Java command line progra...

How to run a batch file through javascript

Hi Friends, I have included the bat file path in anchor tag like this <a href='pdfs1255601585.bat'>Execute batch file</a> But its showing some security warning, before executing the bat file.. Is it possible to bypass that warning to run.. Orelse, is there any other way to run the bat file through javascript Thanks,Praveen J ...

How to blank files in batch

How would I go about reading an entire directory and blanking files with a specific extension? I have an application that reads the content of a specific folder and returns an error if a file is missing, however it does't check to see if the files are valid, so I want to make them NULL to get around the checks. ...

Windows batch parse template and increment values

Hi, I'm trying to write a windows batch file that would read in a text file with certain text in it and increment some values in that file. The text file would contain text like : public static const COUNTER:int = 0 the batch file would then search for "COUNTER:int = 0" and increment the 0 value. Unfortunately my knowledge of windo...

C# DataSets batch updates

I have a number of rows to update/insert to a SQL Server database using TableAdapters. Is there a way to batch them together, so that while it's still a list of UPDATE statements, at least it's only one remote call to the database? If I was writing SQL manually, it would be a single SqlCommand object with a CommandText that looks somet...

How can I suppress the “terminate batch job” in Win7 cmd.exe

As discussed in another question, it's possible to patch cmd.exe to suppress the "Terminate batch job (Y/N)?" message. Patching instructions are available for Windows XP. Unfortunately, these patching directions are out of date for Windows 7, and I don't know enough assembly to update them. (I do know how to use a hex editor, and was a...

Paste two text lists (one list a file) into one list separated by commas

An example of the process/output would be: File1: hello world File2: foo bar Resulting file after concatenation: File3: hello;foo world;bar For a large list of non-predictive text (no-wild cards - but lines are aligned as above). I cannot figure out how to do this with the paste command under Ubuntu. ...

Connected to mysql instance ONCE or TWICE?

Hello there, I was wondering whether the following command (from a .bat script): (1) connects to the mysql instance once and then executes script#1 followed by script#2, or (2) does it reconnect for each of the sql scripts? mysql -B -b -h%HOST% -u%USER% -p%PASSWORD% %SCHEMA% < "scripts\create_and_populate.sql" < "scripts\update_joomla_...

Problem with calling a run file from c# Application

I am using a C# Application to call a Batch file which compiles and run a java program. (This is a scraper project which grabs content from websites.) The batch file consists of following command: java -classpath core.jar;mysql.jar;realtouch.jar; com.parser.MainClass C:/wamp/www/C21_real2/properties http://www.realestate.com.au/reale...

How do I turn the content of a var in an absolute path?

Suppose I have this: set X = .. How do I turn that later into an absolute path? Can you please write how it would be in a script? I tried with %~dpX , but that gave this error message: The following usage of the path operator in batch-parameter substitution is invalid: %~dpX ...

Upgrading Client version via msi

Hi All I have a client version of a software called KRONOS and i need to update this via a batch file that will run a MSI. First I need to check to see if the application is installed. If it is, I need to see what version it is to see if I need to uninstall prior to installing the new version. I was thinking of using something to che...

Batch/Windows: Random Numbers.

Hello, I am developing a card game for batch. [will give a link when done] Basiclly what i want to do is 'set' '%random%' to '%numbs%. set %numbs%=%random% And then i want the user to type one value from the %random% numbers displayed echo %numbs% Set nuchoo= set /p nuchoo=Number: What my question now is about how to check if the...

How do you find the current user in a Windows environment?

When running a command-line script, is it possible to get the name of the current user? The OS is Windows XP. ...

How to batch execute php script from one php script?

I have a series of php scripts that I want to run in a particular order. I tried using: <?php exec('file1.php'); exec('file2.php'); exec('file3.php'); ?> to accomplish this, but just got a series of errors. If I run them from the command line, they all work fine... I'm not sure how to do this... if someone can help, that'd be gre...

Choice command not differing

I have written the following code choice /m "Do you want to add another profile" if errorlevel 1 set /p profile_name1=Enter one of the above profile names: However it always runs "Enter one of the above profile names:" even though I pressed no. What did i do wrong? Thanks! ...

batch file for configuring my network setings

i want to write a batch which will have the same effect as follows. Here's what I do manually (which I want to program to do automatically): 1) START -> Run -> cmd (get command prompt) 2) ipconfig /release 3) START -> Connect to -> Show all connections 4) Right-click "Local Area Network" and click "Properties" 5) Highlight "Internet Pro...