batch-file

Creating a FileName as a Timestamp in a Batch Job...

Hey Guys, We have a batch job that runs every day and copies a file to a pickup folder. I want to also take a copy of that file and drop it into an archive folder with the filename yyyy-MM-dd.log Whats the easiest way to do this in a Dos Batch Job... I'm basically looking for an equivalent of the unix command cp source.log `date +...

Count active sessions in J2EE app deployed on JBoss 3.2.1

Hi there, I manage a J2EE application which is deployed on JBoss 3.2.1. As part of my service to my client I want to provide reports which show the number of active sessions. I have implemented a simple class and a JSP page which retrieve the number of active sessions, but I have discovered a flaw: the process of checking the number o...

bat file to uninstall an installed application

Hello, I am using the following bat file to install my application on a user computer. However, the client want to be able uninstall the application if the application is installed, and then install the new version of the application. However, I have 2 problems. 1) how can I detect if the application is installed or not? 2) If it is ...

Why is msbuild and link.exe "hanging" during a build?

We have a few C++ solutions and we run some build scripts using batch files that call msbuild.exe for each of the configurations in the solutions. This had been working fine on 3 developer machines and one build machine, but then one of the projects started to hang when linking. This only happens on the newest machine which is a quad co...

how to pass the parameter into batch file?

how to pass the parameter into batch file using java runtime.exec(). **Process pp = run.exec("C:\Program Files\Apache Group\Tomcat 4.1\bin\RMIClientInvoker.bat C:\Program Files\Apache Group\Tomcat 4.1\bin localhost date");** when i using this coding error will occur.the parameters are last three part.batch file is RMIClientInvoke...

How to run a batch script (.bat file) from eclipse

My Java application is started by running a set of commands that are present in a batch file (.bat file). And I imported this into Eclipse workbench. How do I execute the batch file from Eclipse. Similar to the one in command line, I directly give "path:\myBatchfile.bat". Is there any way I can do directly from Eclipse. ...

How to hide cmd window while running a batch file?

How to hide cmd window while running a batch file? I use the following code to run batch file process = new Process(); process.StartInfo.FileName = batchFilePath; process.Start(); ...

Questions about a possible replacement of batch files on a Windows application?

I've got a big Windows legacy application composed by many executables interacting with a database. Executables have 4 main purposes: (a) parsing and loading a file on a database (b) transform a file (e.g. encode a file.) Tthis may as well split a file in many parts. (c) perform some sort of complex updates in the database (d) produc...

How to pass a parameter from Batch file to a function inside a Powershell script

I have a Batch file which will call a Powershell Script : BATCH FILE : @ECHO OFF powershell ..\PowerShellScript.ps1 The powershell script in turn has a function which expects a parameter : POWERSHELL SCRIPT: function PSFunction([string]$Parameter1) { Write-Host $Parameter1 } Lets say i have a value : VALUE1 which needs to ...

Adding editors in Visual Studio "Open With..." dialog box

I added a batch (.bat) file to my project. I want to add a new editor for batch files that would actually execute this batch file in command prompt window. What I did, but didn't remember my editor: Right clicked on my .bat file Selected Open with... Clicked Add Set program as "cmd /c" and some Friendly name Accepted this dialog. A ne...

Windows batch file for renaming file at specified interval

I would like to write a windows batch file for the purpose of renaming a file every 25 seconds. I would also like the batch file to terminate after 300 seconds have passed. How would I go about doing this? Here is what I have thusfar. START RENAME test.g test.go SLEEP 25 RENAME test.go test.g GOTO START ...

Update desktop "show window contents while dragging" setting programatically.

Hi All, One of my programs seems to be changing the Display Properties > Appearance > Effects > Show window contents while dragging setting to off every few hours. I'm not sure exactly which program, or when it happens. I have a number of programs that seem like likely culprits - wallpaper rotators, software for multiple monitors, mul...

How can I move the contents of one directory tree into another?

I have a directory which contains files and a number of levels of subdirectories: C:\Source I would like to move the contents of C:\Source into: C:\Destination Requirements: All files and all subdirectories within C:\SourceData must be moved I will be running the command in a batch file I can't use Powershell or any other scripti...

run command in each subfolder

What is the easiest way to run a command in each subfolder of a path? In this case I have to run svn cleanup for every directory in my repository. ...

Batch Script Install Process

I am planning a procedue to release our software to our customers using an advanced version of an existing procedure which uses windows batch scripts. I am hoping to improve this process and automate the installation of the following items: Files. Files are simply copied to a destination. MSSQL Databases. I guess I'll use the OSQL comm...

Using JSMin in a batch file

I'm trying to create a batch file that will run Doug Cockford's JSMin against all the .js files in a directory. Here's what i've got: for /f %%a IN ('dir /b /s *.js') do jsmin <%%a >%%~da%%~pamin\%%~na.min%%~xa The problem is that the angle brackets (<>) cause the batch file to interpret it as 0< and 1>. Event running just: jsmin <s...

PHP - I need to run a .cmd file from within PHP and display the results

I need to run a .cmd batch file from within a php script. The PHP will be accessed via an authenticated session within a browser. When I run the .cmd file from the desktop of the server, it spits out some output to cmd.exe. I'd like to route this output back to the php page. Is this doable? Thanks in advance for your time. ...

Apply attribute to property get/set methods via batch file.

I'm trying to automate the generation and cleanup of partial classes created using the .net framework's XSD too. My main problem is that [System.Diagnostics.DebuggerStepThroughAttribute()] affects the code in my partial class as well as the automatically generated one. I can delete the offending attribute in the same batch file that I...

A batch file to detect and display windows based information such as service packs.

I would like to have a batch file display which service pack it has installed, which internet explorer version it has installed, and which version of windows media player it has installed. This would be for windows xp only. The reason why I need this is because I have a script that can install windows updates offline but when it comes ...

TortoiseSVN from the command line and "IF ERRORLEVEL"?

I have a batch file I'm running from a Windows XP w/service pack 3 workstation which applies SQL changes to a database using sqlcmd.exe in SQL 2005. I've got a command-line entry for TortoiseSVN to automatically update the local copy of my repository like so: tortoiseproc /command:update /path:"C:/SVN/My Code/Dev/2009.07.23" /closeonen...