Batch processing is the execution of a set of commands or software programs without user intervention. A batch file is a text file containing a sequence of such commands or programs invocations.

learn more… | top users | synonyms

0
votes
1answer
4k views

How to append text from one txt file to multiple txt files in batch?

I have one .txt file with some text that I want to append to all .txt files in a folder. Can anyone explain to me how to do it?
5
votes
2answers
25k views

Windows batch file if else usage

Sorry I am new to this stuff. I'd like to run in a certain sequence the same bat file with different parameters. I wrote a very simple batch file: @echo off REM Note: to see all command line usage ...
2
votes
2answers
10k views

Trying to read a text file content and set variables values from that

I have a batch file that creates a text file with its output like the following: RESULT=0&SECURETOKEN=SmH3kciXiVkiwD0i70CwKYgAR&SECURETOKENID=2013031414280240&RESPMSG=Approved The ...
-2
votes
1answer
340 views

How do I make a batch file that looks exactly like a command prompt?

I want to make a batch file that, when run, looks and works exactly the same as a command prompt, except that I can do something with everything the user enters (e.g. logging it). How can I do this?
1
vote
1answer
187 views

I want to get only the Filename in Windows Command Prompt

I have a problem: I want to get the filename only from this path line in Command Prompt Here's my path: \\jktfile-01\lsmk\SRP\BankPelapor\201209\Instance\2882000-2012-09-30-BSMS26.xml What kind of ...
0
votes
1answer
1k views

Export the first three rows of a .csv into another .csv using batch commands

I have a .csv file with a number of rows but I only want the first three rows and none of the rest. How can I use a batch file to export those top 3 rows of my .csv file into another file .csv file? I ...
1
vote
3answers
936 views

How to write a batch file to append each item (of a list of directories read from an external file) to PATH?

How can I translate the batch file from rem working batchA.bat PATH=%PATH%;C:\Program Files\gs\gs9.07\bin PATH=%PATH%;C:\Program Files (x86)\Adobe\Reader 11.0\Reader PATH=%PATH%;C:\Program Files ...
2
votes
2answers
629 views

How to get continuously updating environment variable in batch file

I would like to access the updated environment variable in 2nd Batch file, which is changing continuously using 1st batch file. The e.var changing continuously using 1st batch file but I am getting ...
1
vote
0answers
504 views

netsh suddenly stopped working - now cannot load IFMON.DLL

The following commands recently stopped working on my system netsh interface ip add dns name="Wireless Network Connection" addr=8.8.4.4 index=1 netsh interface ip add dns name="Wireless Network ...
1
vote
1answer
2k views

How to use variables in sed on Windows?

I'm writing a batch script to automate build events on Windows, and as part of it I need to change some lines in a few files. So I'm going to use sed. But how do I use variables in sed inside a batch ...
1
vote
1answer
276 views

How do I create a bat file to convert video files in a folder using ffmpeg

I would like to create a bat file that will go to a certain folder that contains video files, look for any files that are not .avi and convert them to .avi using ffmpeg. I don't need, and don't want, ...
2
votes
2answers
543 views

installer script for multiple software packages

I will need to package an older java application with it's dependencies on Windows which are quite a lot. I've exported a runnable .jar and got the depending native libraries, but still I need to make ...
2
votes
1answer
512 views

Starting a program in a bat file using the Path variable

I often use a command line application. Its path is defined in the environment options, so in the PATH variable. When I manually launch the console and if I type the program name, it's launched. For ...
2
votes
0answers
284 views

Imagemagick batch converting memory overload

I must to convert about billion of images from jp2 to jpg... I create such .bat for /d %%d in (*) do ( for %%f in ("%%~d\*.jp2") do ( convert -limit memory 0 -limit map 0 "%%~ff" -quality 25 ...
0
votes
1answer
137 views

Find the character in line?

I am trying to find the some character in file using find or findstr, for example file contents like: "/test/abctest/abci.txt = c:\abctest\tst\work\workt.txt;abc_test1" "/test/abctest/abci.txt = ...
1
vote
1answer
220 views

batch file to copy files keeping originals in other folder

For example I have folder: F1\F11\some files... F1\F12\some files... F1\F12\F121\some files.. And I have another structure F2\F21\some files... F2\F22\some files... F2\F22\folder\some files... ...
1
vote
1answer
75 views

desktop shortcut does not work

I have created batch file that start apache and mysql server,copy try.exe on desktop and run project in browser.that works fine.but onclick desktop shorcut error occured.error is windows can not find ...
0
votes
0answers
741 views

Boot from USB and run batch file

I'm trying to boot from USB and run a batch file that will mount the computer's main hard drive and will copy a file from the root directory into a specified directory on the computer's hard drive. I ...
0
votes
1answer
611 views

Need a script to calculate batch file execution time

I need a script that I can call/include from another batch file (.bat) that can calculate the amount of time it takes to execute the first batch file. The script would be used for automation on both ...
2
votes
1answer
24 views

Define 0 folders found to execute a subprocess

How can I define that 0 (number zero) folders are located within the current directory?. I´m asking this due to within a batch program, I cant make that this condition be true in order to go to ...
1
vote
2answers
5k views

Get disk/partition size in batch file

How to get total size of a disk or partition(a USB hard drive with 1 NTFS partition) in a batch file? I would rather not go for logic that go over files recursively(the ones with for /f) since it's a ...
0
votes
2answers
2k views

Automatically import a macro to Excel and run it

I have made a module i.e. a .bas file which does the work I want to do in Excel. I have to work with this same module in four different files everyday. Now I want, let's say, a script which ...
0
votes
2answers
33 views

Management of directories and subrutines

From the current directory %CD%, I need to go inside a subfolder and execute a subrutineA, then go back to the %CD% directory and go to the next subfolder and execute the same subrutineA, this process ...
2
votes
2answers
1k views

Linux command line tool to batch rename MP3 files based on ID3 tag info, or give random name if no ID3 info present

I have a bunch of recovered mp3 files that have system generated filenames. I want to use any embedded ID3 tag info in the files to rename each one to something human readable. I've tried 'mp3rename' ...
1
vote
1answer
1k views

Windows batch file or script to load exported Wi-Fi XML profiles onto a new laptop

This probably is as simple as reconfiguring the standard code used by MS for the same thing but .. I hope maybe someone has already done it. You can easily export a Wi-Fi profile to a USB including ...
2
votes
1answer
126 views

How does the start batch command execute a software by calling only its name? [duplicate]

For example I launch superuser.com via firefox by this command: start firefox http://superuser.com How does "start" know where is my firefox.exe? I guess it reads it from registy (it is not defined ...
0
votes
2answers
3k views

Bat script using WMIC causing issues

I am trying to write a script to install the correct display driver. Long story short on newer systems when you add a dedicated card the onboard is no longer disabled so when I run this command: FOR ...
0
votes
1answer
183 views

Network computer shutdown unless a specific process is running

I wish to create a batch file to shutdown a list of computers on my network. That's easy enough with psshutdown from PSTools or even the regular shutdown command. My problem is that I wish for the ...
0
votes
3answers
2k views

Windows .bat fails when running from Scheduled tasks; runs fine when running from command line

I am trying to start a virtual machine via a batch file. The .bat file runs fine when I run it from the Windows command line. But when I run it from scheduled tasks, it exits with error code 1. I ...
5
votes
4answers
8k views

is there an escape for '&' character in the command prompt?

I am trying something like: set pwd = abc&123 echo password %pwd% I get the result as... '123' is not recognized as an internal or external command, operable program or batch file. password ...
1
vote
1answer
49 views

How do I add a folder value to a command?

I'm trying to get a simple batch file to work. set locDir="C:\Users\jp2code\My Projects\VS\Live\Mainframe\DataFactory\AppServerLib\" notepad.exe locDir+readMe.txt ECHO Complete! When I run the ...
0
votes
2answers
167 views

User input in Batch doesn't work in Windows 8, or am I wrong?

@ECHO OFF CLS SET ad = SET /p ad = Do you want to [A] Allow or [D] Deny? ECHO "%ad%" I type A and press Enter, and the output I get is: Do you want to [A] Allow or [D] Deny? "" Why doesn't it ...
-1
votes
1answer
3k views

Batch file to obtain system info of remote servers list with unique login credentials

I'm not familiar with scripting. I have a task at hand which requires to check server uptimes to make sure if they were actually re-booted when they suppose to. I was going through Google Search and ...
1
vote
2answers
525 views

Making Windows scripts run in Unix

IS there any way to make Windows scripts (BAT) files run on a Unix machine? Like importing a function or a library for example, which is only recognised on the Unix OS, but has no effect when run in ...
2
votes
2answers
588 views

Batch command to move all files of certain extension

I have a script which uses 7zip to extract all rar files which is great. The only problem is then I have to manually go through the folders and move the .avi or .mkv files. The script I am currently ...
0
votes
2answers
1k views

Windows 7 - Shortcut - Target Attributes too long

I need to launch a shortcut to a program (vlc.exe) and have it launch with certain attributes (it's quite a long string) and the target box will not accept enough characters. I need help finding ...
0
votes
1answer
1k views

batch move for different file types to different folder name

I have files containing in C:\foldername1\Files\soandso1.mkv C:\foldername2\Files\soandso2.mp4 C:\foldername3\Files\soandso3.avi I want to move the .mkv, .mp4, and .avi back to it's parent folder, ...
0
votes
1answer
345 views

Batch file wich runs a .class file inside a path

I would like to make a batch file that: Opens cmd.exe Within that Command Prompt runs cd C:\mywork\ then runs set path=%path%;C:\Program Files\Java\jdk1.7.0_05\bin and at the final runs java ...
2
votes
2answers
661 views

Linux job queue for FFmpeg conversion

I'm starting up a Debian web server which will host a website where users can upload video files and play them. Hence, the video files need to be converted into the proper format (mp4, ogg, webm) for ...
1
vote
0answers
545 views

Script working but throwing 'The syntax of the command is incorrect.' error

I am trying to use this script here: http://www.logaans-site.co.uk/2009/10/17/simpler-version-of-the-7-zip-backup/, it works but is throwing a "The syntax of the command is incorrect. " message. Can ...
1
vote
0answers
428 views

Refresh Domain Credentials Cache via command-line

Is there a way to refresh the cache a domain-computer keeps to store domain passwords? I have a PC that is infrequently on the network, and the occasion happens where I would like the manually update ...
1
vote
2answers
8k views

Create a text file using user input from a batch file

Is it possible to write a batch file that will create a popup window for the user to input some specific information, and place that information into a text file? The text file should already have ...
1
vote
2answers
2k views

Comparing part of a filename in a windows batch file

Consider this script: SETLOCAL EnableDelayedExpansion for /F "tokens=2 delims=." %%G in ("%1") do set partial_name = %%G if partial_name GEQ 9200 ( move I:\rosa\transfertmp\%1 L:\OSLDos\Tmp\ ) else ...
-4
votes
2answers
2k views

Batch script to write color output and output prompt character

I need to write a batch script which configures this list of commands: Put the name of the window "Cmd configuration" Put the color of the text in green. Put the prompt character "$" Show the ...
0
votes
1answer
507 views

.Bat file that opens 2 URLs in different browsers then click on button located on the each page

I Would like to click on .Bat file that opens 2 URLs in different browsers (Firefox and IE) then click on button located on the each page (ex. Submit or login buttons) . This is what I got so far in ...
0
votes
3answers
995 views

make a copy of all arguments in a batch

Since the values %1, %2, %3...etc in a batch can't be modify, I need to create a copy of it. Question: Q1: How to create a copy in one go? Not like SET cp1=%1, SET cp2=%2, ...etc. Q2: Can one ...
1
vote
1answer
800 views

batch script help, find, replace registry keys

I'm trying to figure out why my reg import command is not working in the script below. When I run the reg import fileName.reg from the DOS it works fine but when included in the script below it does ...
1
vote
1answer
560 views

On Windows 2003 how can I get the active power scheme using powercfg?

On Windows 7 I can use the parameter getactivescheme to get this information. How can I get it on Windows 2003? On Windows 7 I can run the following code: PS C:\Users\e> powercfg -getactivescheme ...
1
vote
3answers
3k views

How to get the Visual Studio installation path in a batch file

Normally, the path is something like C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\. From Visual Studio, one can use $(VCInstallDir)$ to get this path. Q: But in a batch file, how to get ...
0
votes
2answers
1k views

Batch video conversion - With subtitle burn-in

I want to convert a folder of .mkv files for online use. By this, I mean burning in the subtitles and if possible, adding two different languages (so Youtube will let the users choose.) Handbrake ...