batch

Batch file variables initialized in a for loop

I have a batch file which initializes variables via SET inside a for loop, for a set of files on disk: for %%f in (%MYTARGETDIR%\*config.xml) do ( SET TMPFILE=%%F.tmp echo In loop %TMPFILE% ) echo End loop %TMPFILE% when I run this in a brand new command shell (without TMPFILE defined) the In loop echo is empty, but the end loop...

How to force delete a file?

How can i force Windows XP to delete file that is currently being used by some application? ...

Vista Recycle Bin Maximum Size

Does anyone know how to set the Maximum Size of the Recycle Bin via script? Whether its written in batch or vbs or just a reg file? I've been exploring this idea for the last few days, and can't get an answer. Maybe someone here knows how. I'm wanting to add it to my Vista Cleanup Script =) ...

write a batch file to add aworkstation in to adomine and add the DNS and WINS ipaddress to that.

hi I want to write a batch file to add a workstation into domine and assign the DNS ,WINS , and static ip address to that workstation. ...

opening multiple pdf documents using batch file

Hello, I am trying to open several pdf documents using a simple batch file: ECHO OFF CLS cd Program Files\Adobe\Reader 9.0\Reader Acrord32.exe C:\Users\BW1.pdf Acrord32.exe C:\Users\BW2.pdf Acrord32.exe C:\Users\BW3.pdf Acrord32.exe C:\Users\BW4.pdf Acrord32.exe C:\Users\BW5.pdf Acrord32.exe C:\Users\BW6.pdf EXIT The above batch file...

how do i get rid of mid spaces in an environment variable

how do i get rid of mid spaces in an environment variable suppose i have the following for loop fragment that get free disk space size of a certain disk for /f "tokens=3" %%i in ('dir ^| find "Dir(s)"') do set size=%%i would result something like this C:\>set size=129,028,096 i wanted to get rid of delims as follows for /f "deli...

Running batchprocesses in Bea Weblogic

We currently have batchjobs in Java that proces mulitple (sometimes large) files. These jobs can take some time to run. We run these files directly in the JVM, using Java Threads that continuesly run in a loop. (proces files and then wait a while). Now the company I work for, wants to run these jobs in the Weblogic application server. N...

sending mail from Batch file

We have a script to backup files. After the backup operation is over, we would like to send a report as an email notification to some of our email addresses. How could this be done? ...

Launch .jar files with command line arguments (but with no console window)

I have to do a demo of an application, the application has a server.jar and client.jar. Both have command line arguments and are executable. I need to launch two instances of server.jar and two instances of client.jar. I thought that using a batch file was the way to go, but, the batch file executes the first command (i.e. >server.bat [...

How to make output filename equals to folder name

I have created a batch file to output a folder content into a list of names. @echo off cd /d %1 Title %~f1 dir %1 /b /l > %1\..\file_list.txt How can I make the file_list.txt to be "dir name".txt? For example I am at folder ABC and I want to output the dir list so that the final text file will be named ABC.txt instead of file_list.tx...

Psexec and calling batch files.

I'm going to try and break this down as simple as I can. There are three computers involved. Local machine (LM), compute node (CN), and data node (DN) will be their names from here on out. I have a psexec command which calls a batch file on the compute node. psexec \\"compute node" -w WorkingDirectory BatchFileName This BatchFi...

How to share log4j library most effectively

i have a few batch java command-line applications which are planned to be deployed as: batch_apps app_1 batch1.jar run_batch1.sh app_2 batch2.jar run_batch3.sh {...etc...} what would be the best practice on organizing a shared library pool - for example log4j: batch_apps app_1 batch1.jar run_batch1.sh ...

Running a stubborn executable in Dos Batch file...

I've got a pretty stubborn executable that I would like to execute sequentially multiple times from within a Dos batch file. (Due to IT constrains currently constrained to using Dos batch files.) I am able to use START to launch the executable, however, it seems the executable is expecting the user to hit return prior to "really" runni...

How can I batch rename files?

Hello, I'm looking for a script (Perl, Python or batch would be fine) that will go through a designated file tree and renames all the child files. For example, Folder1>File1.anytype becomes Folder1>Folder1File1.anytype. Thanks ...

How to use newline character in text in cmd batch?

I would like to do svn commit -m "<message>" But message should have two lines: Commit by: firstuser Bug track: 9283 How to add new line character into message? I've tried SHIFT+ENTER, CTRL+T but it does not work. I use MS cmd command line. ...

How can I detect the drive letter of a booted USB drive from script?

I'm launching WinPE 2 from a bootable UFD, and I need to detect the drive letter in order to tell ImageX where to find the WIM. However, depending on the machine I'm imaging, there are different mounted drives. I need a way to consistently mount the UFD at, say, P: or something. Is there a way to detect the letter of the drive from wh...

Time to display OS and time to display recovery options

I really enjoy automating things to make life easier for my self. I have tried looking around on this site as well as just Googling my question but nothing has come up to even point me in the right direction. So here is my question. I would like to: Disable (aka uncheck) Time to display list of operating system. Set Time to display ...

How to return an error from .bat in Visual Studio (2008 SP1) project?

I have a batch file that's being run in a Visual Studio custom build step to copy files into an install directory. I want it to error out properly when the copy fails. The problems with the options I have are: exit 1This works within the build sequence fine, but sometimes I want to use the batch file from the command line or from withi...

Check for null variable in Windows batch

I'm working on a Windows batch file that will bcp three text files into SQL Server. If something goes wrong in production, I want to be able to override the file names. So I'm thinking of doing something like this. bcp.exe MyDB..MyTable1 in %1 -SMyServer -T -c -m0 bcp.exe MyDB..MyTable2 in %2 -SMyServer -T -c -m0 bcp.exe MyDB..MyTable3 ...

How to wait in a batch script

I am trying to write a batch script and trying to wait 10 seconds between 2 Function calls. sleep 10 does not wait for 10 seconds I am running XP ...