batch

Batch : list all the subfiles with their absolute path

I want to generate a classpath automatically with all the *.jar files contained under my lib folder. I can't find a way to list all these files with their absolute path, so that I can build my classpath variable. It seems the dir command do not allow to get the absolute path, even when you go recursively with a /s. Basically what I h...

Run multiple sql files in mysql batch

to run a single file you can run in mysql .\ filename or you outside of mysql you can run mysql < filename I have a directory of sql files so I'm trying to run them all at once by using a wildcard *.sql but it doesn't work. Any ideas? ...

configure batch to sent minute info instead of entire stdout

Hi all, I am working on a RedHat server along with several other users. We use the batch utility to set a job queue. Some of the programs that I use write stuff to stdout during the run, with info on who much data has been processed to far and estimated time until completion etc. batch -q z at> myScript -i somefile -o someotherfile ...

Editing "Time to display recovery options when needed" timeout value using a program

Hi all, I want to edit the timeout value of 'Time to display recovery options when needed' without using the UI display option. To navigate, Right click on 'Mycomputer' -> Properties -> Advanced tab -> click on SETTINGS of 'Startup and recovery' => 2nd displayed check box. The value thought to be in c:\boot.ini file, but it has value of...

Processing Semicolon on Command line

I have two batch files which is used to run a large c+_+ build, the first one starts the processes, creating directories and figuring out what to send to the second script. If certain information is presented to the first script, I have a routine that pops up a window and asks for a password. This is passed to the second script by callin...

Postgres createuser.exe silent execution from batch script

I am finding myself with the issue of needing to execute the postgres createuser.exe from a batch script and cannot get it to stop prompting me with the following: Enter name of role to add: my batch script looks like this: echo calling createuser! createuser username %super_user% -s -U Super_Postgres s -q Where %super_user% is a com...

Best way of implementing a batch like operation in a RESTful architecture?

Hello, We have a predominantly RESTful architecture for our product. This enables us to nicely implement almost all of the required functionality, except this new requirement thats come in. I need to implement a page which lets the user to large scale DB operations synchronously. They can stop the operation in between, if they realized...

Administrator's shortcut to batch file with double quoted parameters

Take an excruciatingly simple batch file: echo hi pause Save that as test.bat. Now, make a shortcut to test.bat. The shortcut runs the batch file, which prints "hi" and then waits for a keypress as expected. Now, add some argument to the target of the shortcut. Now you have a shortcut to: %path%\test.bat some args The shortcut ...

Extracting columns from text file using Perl one-liner: similar to Unix cut

I'm using Windows, and I would like to extract certain columns from a text file using a Perl, Python, batch etc. one-liner. On Unix I could do this: cut -d " " -f 1-3 <my file> How can I do this on Windows? ...

how to suppress output in R

Hi, I would like to suppress output in R when I run my r script from the command prompt. I tried numerous options including "--slave" and "--vanilla". Those options lessens the amount of text outputted. I also tried to pipe the output to "NUL" but that didn't help. Thanks a lot, Derek ...

Postgres command line install from zip file fails to properly start the windows service after the database has been configured

Below is the batch file I am kicking off at the end of an installer to properly configure my postgres database, however there comes an issue wherein the service is unable to be started. This is what the service parameters look like: C:\Program Files\pgsql\bin/pg_ctl.exe runservice -N "MyPostGres" -D "C:/Program Files/pgsql/PGDATA" ...

What's the equivalent of the bash in windows batch?

while [1 = 1] do eject sleep 1 eject -t sleep 1 done And this is said to be the same: watch -n 1 eject -T What does it do?What's the equivalent in batch? ...

DOS batch file to read contents of a file and rename the file based on a condition

I need to create a batch file that reads a file with one line and then renames the same file based on the contents. The file will have one number and the condition to rename the file is this: If content of file > 100 then rename new.txt to old.txt else rename new.txt to new1.txt Thanks for the help! ...

dos batch iterate through a delimited string

I have a delimited list of IPs I'd like to process individually. The list length is unknown ahead of time. How do I split and process each item in the list? @echo off set servers=127.0.0.1,192.168.0.1,10.100.0.1 FOR /f "tokens=* delims=," %%a IN ("%servers%") DO call :sub %%a :sub echo In subroutine echo %1 exit /b Outputs...

Windows batch file to delete .svn files and folders

Hi,in order to delete all ".svn" files/folders/subfolders in "myfolder" I use this simple line in a batch file: FOR /R myfolder %%X IN (.svn) DO (RD /S /Q "%%X") This works, but if there are no ".svn" files/folders the batch file shows a warning saying: "The system cannot find the file specified." This warning is very noisy so I was w...

When appending to a file using Windows batch commands, how to append immediately after the next word in the file?

When appending to a file using Windows batch commands, how to append immediately after the next word in the file? For example, these commands echo here is the date of > c:\arun.txt date /t >> c:\arun.txt write the following text to the arun.txt file: here is the date of 29-03-2010 But I want the output to be like this: ...

What is the proper way to test is variable is empty in a batch file, If NOT "%1" == "" GOTO SomeLabel, fails if %1 has quotes.

I need to test if a variable is set or not. I've tried several techniques but they seem to fail whenever %1 is surrounded by quotes such as the case when %1 = "c:\some path with spaces". IF NOT %1 GOTO MyLabel // This is invalid syntax IF "%1" == "" GOTO MyLabel // Works unless %1 has double quotes which fatally kills bat execution IF ...

Check if files in a directory are still being written using Windows Batch Script

Hello. Here's my batch file to parse a directory, and zip files of certain type REM Begin ------------------------ tasklist /FI "IMAGENAME eq 7za.exe" /FO CSV > search.log FOR /F %%A IN (search.log) DO IF %%~zA EQU 0 GOTO end for /f "delims=" %%A in ('dir C:\Temp\*.ps /b') do ( "C:\Program Files\7-Zip\cmdline\7za.exe" a -...

Moving a large number of files in one directory to multiple directories

I am looking to create a Windows batch script to move about 2,000 files and splitting them up so that there are 10 files per folder. I have attempted creating a batch script but the syntax really boggles my mind. Here is what I have so far @echo off :: Config parameters set /a groupsize = 10 :: initial counter, everytime counter is 1...

What's the best way to convert Windows/DOS files to Unix in batch?

Basically we need to change the end of line characters for a group of files. Is there a way to accomplish this with a batch file? Is there a freeware utility? ...