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. Please use the tag [batch-file] for that.

learn more… | top users | synonyms

2
votes
1answer
36 views

CMD batch escaping enviroment variable in params

I have to write a batch file with a enviroment variable a param: c:\myapp.exe -f "%APP_HOME%\file.conf" I need to pass exactly the string "%APP_HOME% as param and not its value. How can I do? In ...
0
votes
0answers
23 views

How can I close all active applications(except things like start bar)?

I am trying to make a small batch script that shall close all applications I have open, but not close the ones that need to be open(for example, to not shutdown the start menu, and also I do not want ...
0
votes
0answers
20 views

How to display which files are getting modified using windows batch

I have a windows batch program which monitors a directory and records timestamps whenever a file inside gets modified. I now want to know which file is being modified. In other words I want to know ...
1
vote
1answer
140 views

Batch merge sets of video files?

I have 158 folders, each containing 5-15 video files that are each a few minutes long. I would like to merge all of the videos into one video per folder, and delete the rest. The folders are named as ...
0
votes
1answer
53 views

Call batch file which calls another batch file using the second ones directory as working directory

Assuming I have a batch file (start.bat) in C:\ with this lines : start cmd /k call dir1\dir2\1.bat start cmd /k call dir3\dir4\2.bat start cmd /k call dir5\dir6\3.bat Inside 1,2,3.batch I have ...
0
votes
0answers
33 views

adding 2 audio files to mp4 in separate streams

I have 3 files I want to combine into an MP4: video1.m2v audio1.ac3 audio1-02.ac3 The following works great if I only want 1 audio stream: for /r %%a in ("*.m2v") do ( ffmpeg.exe -i ...
2
votes
2answers
111 views

Fractions in Batch

Why does the following code return 0? @echo off set a=100 set /a a=%a%*(50/%a%) echo %a% pause I assume it's because batch at some point evaluates (50/100) as 0.5 and rounds it down to zero ...
9
votes
3answers
447 views

Virtual Desktop Properties To Command Line

Is there a way from the command line (wmic, regedit, or dedicated tool) to check how many Virtual Desktops in Windows 10 are active, in which a window is, and which one the computer is currently ...
0
votes
2answers
49 views

Batch to find all specific folders

I have several folders named "temp", and I would find them, but when I run the application, only the first instance is shown. What should be done to show the others? @echo off for /d /r "c:\" %%i in ...
0
votes
3answers
78 views

Loop through text file stripping part of the string using batch

How can I use windows command line to do the following? C:\Users\My Computer\SkyDrive\WORK ORDERS\Subdivision\Sec. 1\12345678_123 LUMINAIRE LN.pdf becomes WORK ORDERS\Subdivision\Sec. ...
0
votes
1answer
55 views

xcopy works, but doesn't

Really odd behavoir on xcopy. I have a batch file as follows "<=create a backup of a service - works fine, backup files created correctly=>" For /f "tokens=1-4 delims=/ " %%a in ('date /t') do ...
1
vote
1answer
72 views

Why does CMD substring not work when BAT called from SENDTO?

I wrote a BAT file to strip a leading '@' off a filename. (Please don't ask why! ...why Windows, why CMD...) :) Here's the BAT file: IF EXIST "%~1" ( FOR /F %%F IN ("%~1") DO ( CD /D ...
-1
votes
1answer
102 views

How to rename multiple files in same folder with same filename using batch scrpt?

i need small help, how to rename multiple files without touching their extension (in this case it winrar extension .r*) with batch script? When i try to rename it with rename command batch script ...
0
votes
1answer
108 views

Windows cmd: escape commands to start cmd from batch file, executing commands that add to PATH

I would like to that a cmd command prompt, which maps a network directory to a local path, and then adds that local path to the (local) PATH variable. I have prepared this kind of .bat script, which ...
1
vote
1answer
152 views

Windows batch file, Looping through files in folder to create a parameter list to pass into another script

I have a Windows batch file that process a bunch of files. As part of this I use the following line: forfiles /p "%~dpn1%LogDir%" /m "%SupportLog%*" /c "cmd /c logreader.py @file > ...
0
votes
2answers
33 views

How to create a batch file to save as date

I have created a batch file which runs on task scheduler for Sage VIP payroll system. The problem I am getting is the date date returns the word date.zip, and not the actual date. Code: V: @ECHO ...
1
vote
2answers
304 views

Find process by thread ID

One of my programs outputs its thread ID for debugging purposes. For testing reasons I'd like to kill the process to which the thread ID belongs. How do I get the process ID if I have the thread ID ...
0
votes
1answer
81 views

Wildcard in rename and robocopy command into batch file

What I am attempting to do is automate some work I do daily. What I would like to happen is a prompt saying What is your name? Then use that answer as a variable to be used in different commands like ...
-1
votes
1answer
93 views

CMD Command Prompt DIR Batch File

I use CMD to create a text file for a directory of directories (ie. 2014 Folder containing folders for each project that year). Piping the DIR command to create a text file is very useful, but would ...
2
votes
3answers
174 views

Batch file won't run as administrator unless via cmd prompt

I'm trying to write a batch file that will turn Apache off and copy some files. This is all I have in the script at the moment: "C:\Apache24\bin\httpd.exe" -k stop If I either run the batch file ...
3
votes
1answer
52 views

Is there anyway—maybe with a batch file—to determine if PDF has odd number of pages, and if so add blank?

Every day I get a large number of PDF files (100+) I need to concat and duplex print. Unfortunately they don’t all have an even number of pages so the print doesn’t duplex correctly. Is there a way ...
0
votes
1answer
100 views

Gradle in Batch file prevents cmd.exe from exiting

I have a batch script that does something like this: call gradle clean shadowJar exit The exit command doesn't seem to work, however. The command prompt window will stay alive even after the gradle ...
1
vote
1answer
260 views

Wmic output into variable

Am trying to write the output of this command into a variable, but can't quite get the syntax to work... My WMIC query is: wmic PATH SoftwareLicensingProduct WHERE "ProductKeyID like '%-%' AND ...
0
votes
1answer
47 views

How can I find all folders with a specific name and delete all contents except for two files with a batch script?

To clean up a project I need to find all (sub)folders named palette-library starting from the current location of a batch script file and then delete all its contents except for a folder called ...
0
votes
1answer
50 views

Using errorlevel in batch file to add network printer

I'm trying to write a script so people can add a network printer by just typing in it's name. REM Adding network printer @echo off :addprinter set /p printer="Please enter the name of the printer ...
2
votes
1answer
272 views

How to run a multi-arguments batch file from a vbscript in CMD?

I have a batch file called "ClockTalk.bat" that has 3 arguments: nircmd.exe speak text "Attention it's now %1 %2, %3 Hours remain to the end of the day" -3 i use a vbscript called "HideBat.vbs" ...
-6
votes
2answers
148 views

How to create a batch file to ftp files in the directory with the name realated to yesterday? [closed]

I have a set of directories with encoded in their names the date. Inside those directories there are files named files.csv. The directories have a standard name as, for example, ...
0
votes
1answer
284 views

How can I over-ride Windows10 default DNS Servers to use OpenVPN assigned DNS servers

A problem has arisen with Windows 10 in that it always uses it's local DNS servers (as well as VPN assigned DNS servers) for DNS resolving, which in turn leads to a DNS leakage scenario. Details ...
1
vote
1answer
29 views

DelayedExpansion & Variable Replacement Issues

I have this batch script which flips through 5 static set variables containing a file path to an INI file which it then reads and searches for a specific string to replace. My issue is that after if ...
1
vote
1answer
26 views

Windows Batch Call Command not passing variable value?

I'm getting strange output when running my script: @echo off setlocal pushd "%~dp0" set Mode=batch if "%Mode%"=="batch" call :BATCH echo %Loc% pause>nul exit :BATCH set "psCommand="(new-object ...
1
vote
1answer
111 views

Batch script to ping an ip range?

I'm trying to write a batch script (psexec is also an option) to scan a range of IPs 192.168.1.1-255 and as output, would like a csv file, something like this: column A column B ...
0
votes
0answers
12 views

Directing the batch pdftotext command result to a subfolder within the directory

Referring to the question in this link, How do I use a for loop and output to a different directory which aims to convert pdf files within a certain directory to text files. The objective was how ...
0
votes
1answer
182 views

Batch fill pdf form from Excel, csv, tsv

I know that I can fill the pdf form, from tsv by using More form options > Import data in acrobat pro. But this fills out only one form with only one row of information. I want to batch fill and ...
3
votes
1answer
280 views

How to open multiple Internet Explorer instances w/ different URL tabs for each instance via batch file

What I'm attempting to do is create a bat file that auto loads every program that I use at work via normal startup. As of now, upon logging into my system I am able to run a desktop cleanup program, ...
0
votes
0answers
124 views

robocopy cannot find the path specified

I wrote a small BATCH-File to sync my PC and Notebook folders for university. REM set tdate=%date: =% REM set tdate=%tdate:/=% REM REM set ttime=%time: =% REM set ttime=%ttime:.=% REM set ...
0
votes
1answer
104 views

Batch file to delete shortcuts from desktops

I have a lab with 30 Windows 7 computers. I would like run a batch file that sends a command to each of these computers that would delete a specified shortcut from the Public\Desktop. This is what I ...
1
vote
1answer
219 views

open html document with excel save as xls with batch file

I would like to run a batch file that will open an html file with excel and subsequently save the opened html file as a xls or xlsx document. Ideally, the batch would then be scheduled to run ...
1
vote
1answer
29 views

Why is this wont work in BATCH, FOR command? Standallone it works

I want to export images from films, as thumbnail, I'm using ffmpeg. My batch command: DEL *.jpg setlocal dir *.mp4 /a:-d /b > foldersTemp.txt FOR /f %%A IN (foldersTemp.txt) DO ffmpeg -i %%A -vf ...
0
votes
0answers
53 views

SSH via Putty is slow (console)

I'm using a batch script (saved to my desktop) to start up my devserver and afterwards run putty. Of course it's just a local server, otherwise I wouldn't save the servers Password like that in a ...
1
vote
1answer
57 views

Converting NEF files to JPEG

What is the fastest way to batch convert NEF files (Nikon RAW) to JPEG? I'v tried FastStone Image Viewer and Nikon's Capture-DX on my RAM-drive but they appear to be very slow, although Capture-DX ...
1
vote
2answers
84 views

Copying files from somewhere within a directory tree to a folder

I have a mirror of a large website that I need to reorganize, most of the images and files I've been able to programmatically move and relink up; however, there are a few (few is a relative term, ...
1
vote
0answers
28 views

Return 'dir' command results into array/list [duplicate]

I want to know how to return the output of the dir command into an array. I'm using the command like this: dir /s /b *.txt how would I put each result (file name) into an array/list. Thanks
0
votes
0answers
64 views

start specific firefox profile with batch and open url

I have the code to open firefox profile. I am using shortcut on Desktop named profileA. start "" /B "C:\Users\UserA\Desktop\profileA" But when I try to open a link via FireFox addon inside it I ...
2
votes
1answer
53 views

How to load files according to Created Date in Windows command prompt

In SQL Server using xp_cmdshell, I was able to load files according to Modified date using a command for e.g., z: & forfiles /m *.jpg /s /d 07/16/2015 /c “cmd /c echo @fdate @ftime @path” But I ...
1
vote
2answers
37 views

Get batch argument by with a variable containing a number

I have a loop that enumerates all arguments. From this loop I want to loop thought all up until the current argument. @ECHO OFF setlocal enabledelayedexpansion SET /a Counter=0 FOR %%a IN (%*) DO ( ...
0
votes
1answer
103 views

Batch Create folders based on file names excluding parenthesis and brackets

I have thousands of files with the following structure: Sample1 (43643) [3235] Sample1 (32352) [6432] Sample1 (35346) [4364] I am trying to batch create folders based on the file name excluding the ...
0
votes
1answer
41 views

Windows batch script to replace a word in a filename

I've got a user that creates multiple exported sets of textures from a visual editing program he uses daily. When these export the filenames come out with a pattern of "texture*" (e.g. texture_43522, ...
1
vote
1answer
48 views

How to run a remote bat file on a local computer

I need to run a batch file, that is stored on a server, locally on a windows 8.1 machine. I can run a shell script in OS X with a curl: cURL "file path" | sh is it possible to cURL in powershell in ...
0
votes
2answers
52 views

Change windows settings via code

I there any way I can use C++ or batch programming to change settings in a windows computer for example enable/disable Services? Or is there a different programming language for that? Which one is ...
0
votes
1answer
78 views

Is there a way to write a Batch-file which will Return services into their Default mode?

I had already twice a problem with my computer were it just went out of controll and most of the functions were incontrolable, including services like Sound, Brightness, Internet and some other. Later ...