batch-file

Identify the PID of a Executing Batch File in Powershell

Hi, I need to identify the P(rocess) ID of an executing batch file from a PowerShell (v1.0) script. Can anyone suggest a way of doing this? Thanks, MagicAndi. ...

batch file loop

I want the syntax for FOR loop in batch file,windows ...

How do I make Firefox open a file with an ampersand in the filename?

I've written some Ruby code to inspect ZIP-files as part of an internal company process. The way we usually launch this code is from a web browser. When you click to download the file, you select "open with" and specify the full path to a small batch file. This one-line batch file looks like this: \\mathworks\public\Matthew_Simoneau\...

system("c:\\sample\\startAll.bat") cannot run because of working directory?

Hi, I have an application and executables. I want my application to run my executables. The executable files are in a folder, lets say in "c:\sample". In this directory there is a batch file that calls my exe's. like: start a1.exe start a2.exe start a3.exe let's name it as startAll.bat and suppose every exe has a data like a1.dat a...

send variables to Visual Studio 2008 build event command line

I would like to send additional parameters to the batch file that I'm running in the "Pre-build event command line" of Visual Studio 2008. I can change directory ("cd") to the current "solution directory" by passing in "$(SolutionDir)\MyProject". Can I pass in the build version? I've set my AssemblyInfo.cs to auto increment (as describ...

For loop ignoring directories with a space in them?

Currently, my simple batch script looks like this: @echo off for /D /r C:\myprojects\AIS\ %%G in (_svn) do rd /S /Q %%G pause Unfortunately, this skips any directories with a space character in them, such as a directory called "My Projects". How do I get around this and make sure I traverse that directory as well? ...

How to run "ANT" command in batch file through PHP?

My batch file includes following code, cd C:\Ant Ant How can I execute this file in PHP. I've tried everything including, system(); exec(); passthru(); but none of these functions worked for me. Please I need urgent help. Thanks in advance, -Avirat. ...

MS Build & Cruise Control - replacing a reference in a project from a 32bit version to 64bit version

Hi Guys, I have a solution which contains a project with a reference to a library that creates PDF files. The PDF library has a 32 bit version and a 64 bit version. During development, the project references the 32 bit version. I am developing on a 32 bit machine. I have Cruise Control triggering a build every time I check something...

Batch file to find all files in a directory containing an HTML string then output list to a text file

Hi, I've made several attempts at this but get nothing but "can't open..." errors, so I'm asking here: I want to find all instances of the string "SOME TEXT" within a directory full of HTML files. Then the search results should be output to a file in that same directory (D:\myfiles) ...

Changing Title attributes of a bunch of music files by a script

I have quite a lot of music files but their title attributes have the track numbers infront of them, like 01.TrackName, 02.TrackName. What is the best way to strip off integers from the file attributes? Edit: I am using windows and all music files are MP3. Any solution as batch files, c++ or .net etc will be appreciated. ...

How to execute a batch file from java?

I want to execute a batch file from a java program. I am using the following command. Runtime.getRuntime().exec("server.bat"); But the problem is I want to give a reative path instead of absolute path so that I can deploy that java project on any comp. The dir structure of the project is like as follows: com | project | ...

How do I insert a CRLF after a comma in a csv file with no crlf's?

Hi, I have been passed a csv file which is just a lod of numbers with commas between then e.g. 1,2,3,4,5,6 etc. There are no crlf's after the commas so I can't import this into excel or a database to further process. Does anyone know how I can process this file using either batch file or VBA to insert a crlf after each comma? Than...

reset IIS remotely

Hi all, I'm going to reset IIS through a batch file. Using iisreset utility, as the batch file will be used by others who may log in the domain without the administrator account of the target server. How can I make the batch script running with proper permission? Thanks in advance! And I also don't want to prompt the user to type in us...

Extract the filename from the first argument

How to extract just the filename (no extension) from %1 ? ...

How to move all mp3 files into a single directory?

I have a bunch of MP3 files split up into artist\album, and I want to move these all into a single directory, and get rid of the directory itself, using a windows batch file (hence the tags) ...

How can I get a Windows batch or Perl script to run when a file is added to a directory?

I am trying to write a script that will parse a local file and upload its contents to a MySQL database. Right now, I am thinking that a batch script that runs a Perl script would work, but am not sure if this is the best method of accomplishing this. In addition, I would like this script to run immediately when the data file is added to...

"cp --parents" in batch file/VBScript

How would you write this having only batch files and VBScript at your disposal in a Windows environment? find -name '*.ext' -exec cp --parents {} destination/ \; Or put it this way: Look recursively in the current folder for some filename pattern (ending with an extension called ext in the example above), Copy each of these files to...

Running windows batch file commands asynchronously

Say, if I have foo.exe bar.exe baz.exe How do I run all of them from a batch file asynchronously, i.e. without waiting for the previous program to stop? ...

Running Sybase SQL commands from DOS/Windows batch file

Is there any way I can run Sybase SQL commands from command prompt. I need to write a batch file which runs an SQL query on machine as a fix for a bug. ...

Passing result of one batch file to another?

I have a batch file (BAT1.bat) which returns the following string: "Login credential: 7o5g4cika" I need to send a part of the result (ie "7o5g4cika") as argument to another bat file BAT2.bat. BAT2.bat 7o5g4cika How can I combine these to a single bat file? ...