batch

Drag a link into a batch file

I like using %1 in my batch files, but dragging a link over from the browser (Chrome) doesn't work. My batch file is echo %1 pause How can I make it accept dragged links? ...

Script to open executables and snap to top left hand corner of desktop

Hi guys I was just wonderin' in a .bat file, if there was a way to call an external .bat file, or even an *.exe and make it open so it 'snaps' to the top left hand corner of the screen ? Cheers ...

DOS/sqlplus "Handle is invalid" error?

I have the following batch script: sqlplus ms/ms@orcl < drop.sql sqlplus ms/ms@orcl < create.1.0.sql This works fine when I double click on the bat file in Windows Explorer and run it. But when I type the command name from the DOS prompt I get an error: C:\>create.bat C:\>sqlplus ms/ms@orcl 0<drop.sql The handle is invalid. C:\...

Variables in batch and registry edit for right-click support

Hello, I have this batch file which needs to do some stuff in a folder. This is what i want: -A shortcut when you right-click. (shell32 i think you should edit with the registry or so...? Can somebody say so?) -If that shortcut is pressed, the batch is opened, and it locates the folder were was right-clicked. It should set this as a ...

Killing a process in Batch and reporting on success

Hello, i have the following batch file, which terminates the iTunes program so, that if i connect my iPod, it's not going to sync it. (I know you can set this up in iTunes.) @echo off :kill cls taskkill /F /IM itunes.exe >nul if %errorlevel%==1 { echo iTunes not found. } else { echo iTunes is killed. } goto kill However, the >nul does...

CMD: Sleep and hit any key, at the same time?

Hello, i have this batch file, which makes constantly a loop. I want the user to be able to terminate it in the batch, not just clicking the X. This is what i need (somehow): @echo off :proc cls rem All kind of stuff... echo Hit any key to terminate... sleep 1 @pause>nul But, of course, sleep and pause can't work at the same time. ...

object specific batch cropping

Is there a way to crop (delete) an object out of a series of image files? The object's characteristics are consistent between files, but the placement along the Y-axis varies. Attached are two examples of files, from which I would like the "step" bars removed. I would like to build a script to be able to recognize and remove them from ...

When does NHibernate cause Sql:BatchStarting/Sql:BatchCompleted

I notice that some queries created by NHibernate are executed as batches whereas others are not. When I profile my database using Sql Server Profiler, the event type for these queries is listed as 'SQL:BatchStarting' followed by 'SQL:BatchCompleted', rather than simply RPC:Completed. Is there any reason why some statements are run as ba...

Ignore percent sign in batch file

I have a batch file which moves files from one folder to another. The batch file is generated from another process. Some of the files I need to move have the string "%20" in them: move /y "\\myserver\myfolder\file%20name.txt" "\\myserver\otherfolder" This fails as it tries to find a file with the name: \\myserver\myfolder\file0name....

My schtasks don't schedule anything. :(

I'm trying to make a scheduled task, and its just not working for me. This is the command I type in CMD: schtasks /create /sc minute /mo 1 /tn test /tr calc.exe /st 19:17:00 /sd 12/14/2009 I'm trying to tell the computer to run calculator every minute starting at 7:09 PM. Although I get a success message after I type this in and hit en...

double quote escaping in os.system on windows

Hi, I want to escape '"' and all other wild chars in program name and arguments, so I try to double quote them. and I can do this in cmd.exe C:\bay\test\go>"test.py" "a" "b" "c" hello ['C:\\bay\\test\\go\\test.py', 'a', 'b', 'c'] but what's wrong with the following code using os.sytem? cmd = '"test.py" "a" "b" "c"' print cmd os.syst...

Distributed Job scheduling, management, and reporting

I recently had a play around with Hadoop and was impressed with it's scheduling, management, and reporting of MapReduce jobs. It appears to make the distribution and execution of new jobs quite seamless, allowing the developer to concentrate on the implementation of their jobs. I am wondering if anything exists in the Java domain for th...

If Service Exists Condition

How would you check if a WIN32 service exists and, if so, do some operation? ...

build script - how to do it

Hi everyone. About 2 months ago I overtook building proccess in current company. Even though I don't have much knowledge of it, I was the only with enough time, so I didn't have much choice. Situation is not that good, and I would like to do following: Labeling files in SourceSafe with version (example ProjectName PV 1.2) GetFiles ...

Why does cmd.exe have different errorlevel behavior on a 64-bit machine?

If I make a batch script named temp.bat (for example) containing: exit /b 1 When I run it in various ways, I get different behavior on my 32-bit XP system vs. a 64-bit XP system. On 32-bit: > temp.bat > echo %ERRORLEVEL% 1 > cmd /c temp.bat > echo %ERRORLEVEL% 0 On 64-bit: > temp.bat > echo %ERRORLEVEL% 1 > cmd /c temp.bat > ech...

For loop in Windows 3.1 DOS

i have wrote a batch script like below for -f %%a in ('dir /b') do command This script works in Windows XP but now I want to run it in Windows 3.11. It gives a syntax error; it seems like Windows 3.1's DOS not support `for -f %%a in ('command'). Can you suggest what command can I use in Windows 3.1 to achieve equivalent functionalit...

how to read from a file in batch?

how to read from a file in batch and set it as variable under MSDos 6.22 (windows 3.11) i have tried set /p var= < text.txt have also tried for /f %%a in (text.txt) do (command) both is work only in windows xp, can anybody suggest in windows 3.11? ...

Edit XML with batch file

Hi, I am wondering if there is any way to create a batch file that can edit a line in an XML document. The line would be identified by the preceding line. the idea would be as follows: If line == Csetting name="BaseDirectory" serializeAs="String"> Next line = <value>User Input from begining of batch</value> is something like tha...

Removing double quotes from variables in batch file creates problems with CMD environment

Can anybody help with effective and safe way of removing quotes from batch variables? I have written a batch file which successfully imports a list of parameters %1, %2, %3 etc. and places them into named variables. Some of these parameters contain multiple words, and therefor are enclosed in double quotes. > "Susie Jo" (%1) > "Smit...

executing copy command in a batch file

hi I'm using a windows copy command to perform auto file backup of Microsoft outlook files for a domain users. the problem exists after 6 month of using this batch file is that the .pst file size for each user is growing and the copy operation is getting too long to complete. i want to know are there any way to copy only the changed bi...