batch-file

Run a batch file and then an exe file from Java program

I'm having two files that I've to invoke from a java program: a batch file that sets the environment. an exe file For running the exe, I need to have some environment variables to be set up, which am doing it with the batch file. set MSDEV_HOME=C:\Program Files\Microsoft Visual Studio 8\VC set FOO_ROOT=D:\UGS\Support_Dev\2005SR1 se...

How can I make an "are you sure" prompt in a DOS batchfile?

I have a batch file that automates copying a bunch of files from one place to the other and back for me. Only thing is as much as it helps me I keep accidentally selecting that command off my command buffer and mass overwriting uncommited changes. What code would I need for my .bat file to make it say "are you sure", and make me type "...

How to capture the data returned from an EXE excuted from a batch?

I've a batch file that needs to be invoked from a java program. The batch file in-turn invokes an EXE. The EXE program will return data which I want to handle. If the EXE prints data to console am able to capture it as follows. But when the EXE is returning data after its completion, am not able to capture it. ProcessBuilder pb ...

How to run a PowerShell script without displaying a window?

How is it possible to run a PowerShell script without displaying a window or any other sign to the user? In other words, the script should run quietly in the background without any sign to the user. Extra credit for an answer that does not use third party components :) ...

Delphi 5 IDE command-line return codes

I am attempting to automate some legacy Delphi 5 builds with an MSBuild script, and am having trouble capturing errors. Thinking there was some issue with the MSBuild passing, I also tried a batch file and am still receiving back passes (0) when the build should fail (1). %2 is the path to delphi and %3 is the project name. REM delphi...

Batch : recursively delete all folders starting with ...

I need to write a command in a .bat file that recursively deletes all the folders starting with a certain string. How may I achieve this ? ...

Firefox profile changing using command

Hi all, I want to switch between two firefox profiles online using bat file without closing my firefox. Is it possible? thanx in advance. ...

How to use psake from a batch file?

What I want is a one file I can double-click that will run the required build process using psake. I'm new to psake and PowerShell so be gentle :-). What I have now are 3 files: File 1: Build.bat PowerShell -ExecutionPolicy Unrestricted -File .\Build.ps1 %1 File 2: Build.ps1 Import-Module .\psake.psm1 Invoke-psake .\BuildTasks.ps1...

Script to list non-Microsoft Services

Hi guys Been lookin' for a way to list the non-Microsoft Services to a *.txt file. Either using vbs or a batch file will be sufficient. I've tried numerous ways with WMI and the sc.exe command, but can't seem to put my finger on it. Thanks, Tim ...

Run a batch file using php

Below is my piece of code , on giving the tool name as the input and pressing submit , the batch file corresponding to that tool shall be executed. <html> <head> <title>My Form</title> </head> <body> <form action="batch.php" method=post> Which tool you would like to use: <br> <input type="text" name="ToolName"> <...

sqlcmd runs script but script does not affect database

Hey all, So we have a .bat file that runs SQL scripts, e.g. @ECHO --- 03_Case6395_Publication.sql --- >> dbupt.log sqlcmd -U %1 -P %2 -S %3 -d %4 -i 03_Case6395_Publication.sql -k -b >> dbupt.log IF ERRORLEVEL 1 GOTO ErrorTag The script runs and gives no errors, but the script doesn't actually affect the database. In the example abo...

recurse directory for file extension with total?

I want to know how much disk space is being used by zip files (or any other extension) in a particular directory tree. Is this possible on the command line (in a batch program)? I can list them, ie: dir /s *.zip or using "forfiles": forfiles /p d:\wincap /s /m *.zip /c "cmd /c echo @fsize" I need it in a batch program, because I wan...

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

How might I use a batch file to read the contents of one file and save it into another file?

I have created a file, file1.txt, the content of this file is like "abcdef". I want to read the content of this file and wish to store content in another file "output.txt" using a batch file. Please let me know how to do it from batch file. ...

read the content of text file nad display on standard output throgh batch file

hi i have created one file file1.txt, content of file1.txt is "abcde". I want to read the content of file1.txt and print on standard output through batch file. How to read the content of file and print on standard output via batch file. ...

7zip, batch file, file splitting, amazon s3

Hi, I try to to use the following batch command to start for each of the files in a the given folder 7zip and split the files into 250 MB pieces. The files should not be zipped (-mx0) because I want have low disk i/o and just want to synchronize them with amazon s3. for /f %%f in ('dir /b c:\Test\') do START 7z.exe a %%f.zip -wc:\Test...

If condition in batch files

@echo off SET var1="Yes" SET var2="No" SET var3="Yes" if %var1%=="Yes" echo Var1 set if %var2%=="Yes" echo Var2 set if %var3%=="Yes" echo Var3 set If I run the above script I get the following error. Can anyone pls help? The syntax of the command is incorrect. Thanks. ...

Find absolute path to a directory if given path to start search from (in a batch file)

A user will give me an absolute path - say "C:\src" (passed into %1 in the batch file). Then, I need to find the directory entitled "SQLScripts" that is in some subfolder of "C:\src". How can I find the absolute path to the "SQLScripts" directory? Also, I'm not worrying about multiple instances of the SQLScripts directory existing. Fro...

batch file fails to set variable in IF clause

The following code is not updating Run to equal N even though the match occurs. this means I'm not dropping into the CALL code. Am i missing something here? SET Run=Y REM Check current files date/time information and establish if the file has been present too long in the directory REM Skip first 4 lines as header information not requir...

"pause" being ignored

I read that I must be able to run all unit tests in my site with a single command, so I created a bat file to do it. Even with pause before the end, after the phpunit command, the result of the unit tests flashes in the screen. @echo off cd c:\ cd xampp cd htdocs cd light cd myworks echo on set /p site=The site: set /p version=The vers...