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

1
vote
4answers
5k views

How to read values in a particular column of a CSV file in Batch?

I am planning to write a batch script wherein I need to scan the values from a particular column of a CSV file one by one and store them in a variable for further processing. Say, following is the ...
0
votes
1answer
81 views

Windows 8 located all drives and run command on each

This is what I have so far @echo off for /f "tokens=2 delims==" %%d in ('wmic logicaldisk where "drivetype=3" get name format:value') do echo %%d output is correct @echo off FORFILES /P C:\ /S /M ...
1
vote
1answer
232 views

Dir and Findstr commands taking a long time to complete in Batch File

dir %DRIVE_NAME%: /S /C /A-D /Q /T:C | findstr ".zip$ .doc$ .xls$ .xpt$ .cpt$ .cpo$ .xlsx$ .pdf$ .dat$ .txt$ .docx$ .csv$" >> file.info I am using above command to list all information in ...
0
votes
2answers
239 views

Creating Comma Separated Values in Batch Scripting

I have written a piece of code in Batch script which is somewhat like : ( wmic.exe /node:x.x.x.x computersystem get name wmic.exe /node:x.x.x.x computersystem get domain wmic.exe ...
1
vote
1answer
3k views

How to open multiple tabs in IE8 from batch file?

Upon searching for an answer to this question, I stumbled upon an almost identical question on this site, to which someone answered: "For launching multiple URLs in tabs in a single IE window, use ...
0
votes
4answers
180 views

Batch Script to find out whether a host is up or down

I need to scan several systems in the network within IP range 172.18.x.x to 172.25.x.x and check whether each of them is active or not, and then dump the result in a file. Following is the script: ...
1
vote
2answers
114 views

Can I use shell: commands to change directory in CMD?

I am trying to create a batch file which installs favorites on all company PCs and Notebooks. Is it possible to change the directory in CMD using shell:favorites? I need this because on the ...
1
vote
2answers
918 views

How to disconnect/connect ADSL modem connection to ISP by command? (Windows 7 SP1 x64)

I want to write that command in a .bat file and run it by windows scheduler at certain times of night and morning. (for example: open connection at 23:00 and close it again next day at 9:00 ...
1
vote
1answer
171 views

Batch file for copying a folder by checking its presence

I am a new user. I want to copy a folder containing some files into another directory. I have to check whether the destination directory exist or not. a. If exists then prompt for user input - want ...
0
votes
1answer
69 views

Renaming all files of a particular type to lowercase batch

In this link Is there a way to batch rename files to lowercase? there is a command given for /f "Tokens=*" %%f in ('dir /l/b/a-d') do (rename "%%f" "%%f") This works when i want to convert all ...
1
vote
1answer
59 views

Batch file to automate a task

I run a job that creates 35 text files. The problem is I need to transmit these files after they are created, but before I can send them I need to go into each file and remove a space in order for the ...
1
vote
0answers
278 views

Nested environment variable does not expanded

I can't explain the below strange issue. I have two system variables: PYTHONHOME = D:\Tools\ISDC_Tools\Scripting\Python.2.7 PYTHONPATH = %PYTHONHOME%;%PYTHONHOME%\Lib After creating a new cmd ...
2
votes
1answer
277 views

Windows Batch - default choice with timeout

In a cmd window, I want to prompt the user for a set of choices (denoted by letters), one being the default. The user can key in a letter or hit Enter, in which case the default choice will be ...
1
vote
2answers
607 views

Taskkill for all running processes that exist in a specific directory

I basically want to combine the following sets of commands. In other words I need to check to see if any executable that exists in c:\apps is running, and if any are, to kill them. Once these ...
0
votes
2answers
1k views

Changing Windows 7 Desktop Background

i've been searching online for a batch solution to change the desktop background of Windows 7 Ultimate 64 bits, and after several attempts, i could only get it to work once but never again... I'm ...
2
votes
5answers
11k views

Renaming multiple files inside a folder using Windows batch commands

This is taking the post located here and spinning things up a bit. As typical, I'm trying to rename several images inside a folder to be the name of the folder they're in and then add the suffix ...
1
vote
3answers
484 views

Batch file, copy files beginning with (A,B,C,D,E)

Instead of running xcopy 6 times, is there a way to define an array of files to copy? xcopy \\\from_location\\(A,B,C,D,E)*.txt \\\to_location\
3
votes
2answers
4k views

run .hta as adminstrator

Simple question how do you run a .hta file as an admin? When I try running runas /user:Grants-laptop\administrator computerinfo.htafrom command line I get this error: RUNAS ERROR: Unable to run - ...
0
votes
3answers
2k views

How can I create a batch job (.bat) that zip a folder?

From 7zip I've downloaded their command line tool 7za.exe, and I have to following script: echo off cls set zip ="C:\7za.exe" set filename="%date%.backup.zip" set pathtobackup="C:\MyDocs" %zip% ...
0
votes
2answers
2k views

Batch File Copy and Move without overwriting

I'm trying to create a batch file (to run in the background) that will copy a single file without overwriting any file in the destination with the same name, and then move the file, again not ...
-2
votes
1answer
279 views

Batch file to copy a file at random to another folder

I need a batch file: Given folder A containing .txt files; e.g., C:\A\a.txt C:\A\b.txt C:\A\c.txt C:\A\d.txt and folder B (which is empty), I need the batch script to copy one randomly chosen file ...
1
vote
1answer
903 views

Launch multiple programs in background on windows 8.1

I want to start (launch) three programs in windows and all of them in Background i.e. No windows. I found two ways (both using vb script to hide a bat) Set WshShell = ...
2
votes
3answers
2k views

Use array to create string in DOS

This is a slightly different question from Populating Array in DOS Batch Script I'm trying to compile a JavaScript application using Google Closure Compiler. The list of JavaScript files has grown to ...
1
vote
0answers
79 views

Trying to create a lock system

I've been trying to create a locking system just to help deepen my understanding of batch files. To clear things up, this isn't supposed to be very complex or even practical. This is just more of ...
2
votes
2answers
7k views

How to create multiple folders and name them by reading lines from text file?

I have a plain text file named Export.txt. It contains a list of geographical places, preceeded by a 3 digit number with leading zeros. Example --START OF FILE-- 001 Aberdeen 002 Bellevue 003 Camas ...
1
vote
2answers
153 views

How do you make “enter” an invalid option in batch script?

I want "enter" to be invalid and to restate the acceptable responses. echo. Do you want to root your Nexus 5? echo. ----------------------------------------- echo. ...
0
votes
1answer
63 views

How to define access to just the System event log on Windows 2008 Server

I want to restrict administrator user access to the Security event log, is there a way to do it? I was following this article, but so far no luck.
-1
votes
1answer
298 views

Batch Launcher With Variables

This batch launcher was created so that batch files won't launch a command prompt window... Now that i'm adding more variables to it, it's not working... I'm launching the VBScript like so; wscript ...
0
votes
2answers
176 views

How to exit a batch script when a command is not found

I want the terminal to close itself if adb is not recognized. ADB is a program this script will utilize to detect device. Here is a bit of my script echo My name is RomBreaker echo. echo And I'm ...
2
votes
1answer
7k views

How to compare 2 strings in batch and determine if variable is alphabets

I have this code for /l %%a in (0, 1, 25) do ( if /i !TextAlphabet!==!Alphabet[%%a]! ( set AlphabetNumber=%%a ) ) !Alphabet[]! is an array containing alphabets. I tried echoing !TextAlphabet! and ...
-2
votes
1answer
86 views

Batch file test for path + file name with extension

Batch file in Windows 7. I want to know how to test for a path + file name with an extension, if it exists or not. I have tried if exists "myfile.ext" It seems not to see the file. Your ...
0
votes
3answers
441 views

Get administrative right in windows command line [duplicate]

I am not trying to do cheeky things, but my need is just to have two scripts for adding or removing IP routes using the following command in batch scripts: Add route: @echo off route add -p ...
0
votes
1answer
88 views

How can I simulate Make's targets within a Windows batch file?

In working towards resolving http://tex.stackexchange.com/a/160685/17423, I'm looking to create a batch-file version of this makefile. Is there a clear/conventional way to simulate the 'target' ...
0
votes
4answers
111 views

Part filename to folder

I've been trying to figure out how to make a dos command that can "see" part of a file name, then create a folder and sort every file which has that part of a filename in it. Every filename has the ...
0
votes
2answers
43 views

get part of the path in recursive operation

I have a directory tree like this c:\work\src\A\D1\foo.txt c:\work\src\A\D2\foo.txt c:\work\src\B\foo.txt I want to run the stream editor (sed) for each foo.txt and replace some text with sed. The ...
1
vote
3answers
6k views

How to control power to USB ports using batch

How can I toggle the power to a USB port on/off using batch or the command line? I am using Windows 8 to do this. Does anyone know what I could do? I have 4 USB ports.
0
votes
1answer
850 views

Understanding a for loop in a batch file to rename files by replacing strings

@echo off Setlocal enabledelayedexpansion Set "Pattern=rename" Set "Replace=reuse" For %%a in (*.jpg) Do ( Set "File=%%~a" Ren "%%a" "!File:%Pattern%=%Replace%!" ) This renames .jpgs having ...
0
votes
1answer
268 views

How to run a batch script which is on a server, but it should be run on a PC remotely

There are many batch scripts on one of our servers that are shared to everyone. These are scripts like Robocopying, portable apps, etc. I am in tech support, and when someone asks me (for example) "I ...
-1
votes
1answer
43 views

How can I type certain days (such as Monday, Wednesday) in an easy way for the next 5 months without typing them one by one?

I am trying to input in a libreoffice calc file only Mondays and Wednesdays for the next 5 months, but I dont wanna do it typing the dates one by one. So..I thought I would type 4 dates like this: ...
0
votes
2answers
78 views

Duplicate Deletion Script does nothing

An associate of mine wrote a script for me that should theoretically delete files that have the same name, regardless of their file type. Specifically, it checks mp3, m4a, wma, wav files. However, ...
1
vote
2answers
343 views

How can I start a VirtualBox VM and then run a batch file inside the VM

I have a lengthy build operation which calls several batch files in succession. Most of these batch files start 32-bit compilers, etc, but one of them involves running a legacy MS-DOS 16-bit app ...
0
votes
2answers
1k views

Batch Printing TIFF Files in Windows

I am trying to batch print .TIFF files efficiently. I have found that I can drag files from windows into the print job queue window and it will print them right from there. With PDF's of varying ...
1
vote
1answer
227 views

Commands run in a batch file only when writing cmd /c before

I am running the following command rabbitmq-server.bat" -detached This command runs a sewrver in the background. When I run it from a batch files - the flow stops and later commands in the ...
3
votes
1answer
1k views

Win7 Task Scheduler Won't Run Copy Commands

I'm trying to run a patch file every morning at 4am. For whatever reason, the lines in the batch file that use robocopy.exe are skipped. I've also tried xcopy and cp(from UnxUtils). The batch file ...
0
votes
0answers
215 views

Export/Convert PNG to HTML table using GIMP batch mode in Windows 7

I need to convert PNG images to HTML tables in GIMP batch mode from the Windows command line and have been unsuccessful using google to find an example I can reuse. I can open the PNG in GIMP and ...
0
votes
1answer
6k views

Windows Batch file to copy latest files to a new folder

I want to copy the latest file from a Folder and its subfolders to a new location. The following code works well, BUT I do not want to filter by Date AND Time (/O:D), but DATE only, so that all ...
0
votes
1answer
100 views

How to associate a file extension to be opened with a batch script?

I want to get rid of OSPPSVC (Office Software Protection Platform Service). Then, I have replaced the links to open Office programs with a link to launcher.bat: @echo off title Launching Office... ...
1
vote
1answer
366 views

Batch change filetype associations on OS X

I just installed Sublime Text 3 beta and would like to re-associate all the filetypes I have linked to ST 2 with ST 3. Is there any way to perform this as a batch operation? For example: $ ...
2
votes
1answer
337 views

Mac OSX Text to Speech Batch

I have 300 English text files that I want to make into mp3 files to listen to as and when. Is there a method, that I could use so that my Mac will batch text to speech the files to mp3 using a ...
1
vote
2answers
616 views

Batch file for starting powershell in a specific directory

I am learning to program in python through the book "Learn python the hard way". Therefore I use powershell to run my programs. Since I had to manually change the directory every-time I started ...