batch

Help with SQLPLUS please? How to make SQLPLUS startup with DEFINE `OFF` initially?

I have a batch script that invokes PLSQL with connection details, which works fine but I still have to explicitly SET DEFINE OFF when I connect. I would like to enhance my simple batch script to pass the SET DEFINE OFF command to SQLPLUS so that once I am connected, I will no longer have to issue that command manually. echo set define o...

how to store hostname in a variable in a .bat file

I would like to convert this /bin/sh syntax into a widely compatible windows batch script: host=`hostname` echo ${host} How to do this so that it'll work on any Vista, WinXP, Win2k machine? To clarify: I would then like to go on in the program and use the hostname as stored in the variable host. In other words, the larger goal of th...

Executing an application after a period of time

I'm writing a small app that needs to be executed once a week. I could write it as a service that runs constantly but only executes the task that I need it to once a week, but that seems like overkill. Is there another way of executing an application once every x period of time? I'm looking for a solution that doesn't involve user inte...

How to make by-turn start of .exe files using the .bat-script

I have directory structure: DIR |-component_name |-source |-setup.exe |-another_component_name |-source |-setup.exe |-yet_another_component_name |-source |-setup.exe and so on... In every directory like "component_name" I have setup.exe file which installs current component to the palette component in Delphi. I need to ma...

How to write a batch file to install an application package on a network which is having 500+users?

I am having an application package which will be useful in prodution environment. I need to install by running a batch file without disturbing the users. ...

Powershell SQLCMD

We were experiencing problems with Powershell and SQLCMD, when there was sapces in the -v parameter variable powershell wouldn't run the command. e.g. sqlcmd ... -v VAR="Some space" Has anyone experienced this before or know how to fix the problem? Thanks, B ...

heredoc for Windows batch?

Is there a way of specifying multiline strings in batch in a way similar to heredoc in unix shells. Something similar to: cat <<EOF > out.txt bla bla .. EOF The idea is to create a customized file from a template file.. ...

Find and rename files with no extention?

So, I've got a bunch of files with no extension. I want to write a windows batch script that will: Find files with no extension (in a specified folder) Add .bla to the end of the file name I'm such a windows batch script noob I don't even know where to start. Suggestions? ...

How can I execute a Windows batch file as a separate process from Java?

I'm writing a class in Java which will be calling a Windows batch file. When I run this class, the batch file is getting opened and getting closed. How can I make the batch file continue to run after the Java program terminates? ...

Usb Autorun and Batch File

I am trying to set up an autorun.inf file and batch file in order to check to see if a program is installed. If not, I want to run the install file upon plugging in the usb drive. Here is my code: setlocal set VMP=C:\Program Files\VMware\VMware Player\ cd C:\Program Files\VMware\VMware Player\ if exist %VMP% ( start vmx ) else ( start ...

Can't get windows task scheduler to run scheduled console application.

I have a console app that uses two batch files to decompress a zip file, take the xls which was decompressed convert it to CSV and BCP the data into a SQL table. I'd like to schedule this console app to run once a day. I set up windows task scheduler to run said app. I try to "test run" the task and don't get an error. I have the app wri...

Forfiles Batch Script (Escaping @ character)

I'm working on a batch script that will let me delete files older then a set period using forfiles. For now, I'm aiming at printing the files that will be deleted. The forfiles invocation I'm using works flawlessly from a cmd.exe shell, but as soon as I embed it into a batch script, it barfs. I suspect that this is due to the @ characte...

Java to batch file

Can any body help me in knowing how to pass a parameter from a Java program to a Batch file which is also used in the same java program. The following stub indicates the piece of code where I run the batch file Runtime rt = Runtime.getRuntime(); rt.exec("C:/test.bat"); I need to know if I could pass some parameters to test.bat which ...

Java to batch file

try { String comd ="E:/ior1.txt"; Runtime rt = Runtime.getRuntime(); rt.exec("C:/tes1.bat"+comd+""); System.out.println("Process exitValue: "); } catch (Exception e) { System.out.println("Unexpected exception Trying to Execute Job: " +e); } But when I run I get an exception like this Unexpected exceptio...

Using batch file to create IIS Virtual Directory from config file

I am creating an automatic deployment script and need to create an IIS Virtual Directory from the configuration file which is created when you Right-Click the virtual directory and select "All Tasks > Save Configuration to a File" I have done some reading and know there is a script included with Microsoft Windows Server called "IISVDI...

Reading a text file line by line in a batch or VBS script?

I have a text file that contains a list of filenames, minus the extension, that I need to create. I want to run a quick batch file command or VBS script that will iterate through the list and then create a file based on the name. The text file looks something like this: PRXI0000466 PRXI0000564 PRXI0000636 PRXI0000681 PRXI0001092 So ...

Batch/Script to run series of BO reports

Dear Friends, I want to build some functionality using VBA / .NET or Java API in Business Objects (WEBI) to submit 500+ WEBI reports to refresh from the command line and the same time I want to return a completion status code. And I need to export them in Excel and PDF format at a particular server using FTP or something related to tha...

Creating batched sql statements

I have a small job that takes a text file of email/zip codes and inserts them into a sql server 2005 table. It reads each line of the source file, checks to make sure that it parses into a valid email address/zip code, creates a sql insert command, adds it to a string builder and eventually executes it. I want to do a single execute inst...

Odd batch escape character problem

I'm trying to execute this mysql command from a batch file: mysql -f -utest -ppass db < alter1.sql However, < is an escape character. I tried nesting it in double-quotes, but the double quotes end up appearing as part of the command. I even put a carrot (^) in front of it, LOOKS fine in the prompt window, but mysql still gets that ^ ...

Realtime data transfer between two or more Oracle databases.

Hi, I'm not a techie as such but have a question which I would like some views on. Currently we have 4 applications runnings on either Oracle 10g or 9i and use OAQ for data transfer but Oracle Streams for within day data transfer. Streams is currently viewed as bringing tight coupling between the applications and such will not be our ...