Questions tagged [batch]

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
27 views

How to Run Batch File when the Active Window is Fullscreen (and on Exit Fullscreen)

As the title states, I want to write a script that detects when a program enters or exits fullscreen; these two triggers will then run one of two .bat files that start or stop the Rainmeter.exe ...
0
votes
0answers
28 views

Batch search and copy multiple (movie) files to a single folder without overwriting files with the same name in the destination folder

I´m trying to create a batch file to separate movies from photos in a huge folder with subfolders. So I made this batch file to search movies formats in all subfoders after a given source and copy to ...
0
votes
0answers
22 views

Run the third party shell commands through a batch file

Let's say I have WSL Ubuntu installed. Now I want to finish the following tasks by a batch file: run Ubuntu in cmd run Python in Ubuntu run Python commands under interactive mode I've tried batch ...
0
votes
1answer
40 views

Powershell GUI - not calling sub batch file

Regarding my Powershell script with GUI: When compiled as a .exe (PS2GUI with noConsole) it works properly, but when calling this same .exe from a .bat, it does not work: It does not start the Start-...
0
votes
1answer
37 views

Problems with psexec accepteula when using psingfo

I made my first script which can get and show the running time of a PC in our network. first it copies the pstools folder to the pc i would like to check. It goes to pstools folder on my PC so i can ...
0
votes
1answer
52 views

How can I remove the Windows 10 Home pin sign-in with a batch script?

I have powercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_NONE CONSOLELOCK 0 powercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_NONE CONSOLELOCK 0 in my batch script but if I restart the machine or put the ...
-3
votes
0answers
18 views

Batch code randomly closes [closed]

So I just started coding yesterday. There are probably lots of problems but there is one that causes my code to randomly close when I complete a certain action. Please help, here is the section of the ...
0
votes
1answer
39 views

Escaping Parenthesis within a file path Parameter in a batch script

I've created a batch script to do some basic file management for me. It's passed in either a directory or file path, along with a category. The program will then Copy the file to another directory of ...
0
votes
0answers
36 views

How do I make a program run as soon as it's downloaded? [closed]

I am trying to make a hello world program that will run as soon as it's downloaded or moved. I am running windows 10, and I am thinking that it would maybe required a batch program to do it. Does ...
0
votes
0answers
11 views

Batch mkvmerge audio tracks in MKV [closed]

I have a folder with: 001.mkv 002.mkv 003.mkv and so on... I already know that I can do this with MKVMerge one by one. This would take a considerable amount of time so... I learned this through ...
0
votes
1answer
40 views

How to delete “explorer.exe” in batch?

So, I was working on a GUI written in Batch only, for a project at school. now that I coded the GUI, it needs to be replaced with the "explorer.exe" located in "C:\Windows" and NO. I am not talking ...
1
vote
1answer
92 views

Need Assistance Resolving Windows Batch For /R Infinite Loop with 7-zip

I have part of this script that I use to individually encrypt/zip files recursively in a folder structure. It works, except it seems one particular folder it will go back and start zipping the ...
0
votes
0answers
19 views

Batch Zipping files - Win10 - Zip groups of files with same first part of file name [closed]

I am set on a project to collect multiple years worth of data (several thousand .pdf files per year) and group them together by company code, which is the first few characters, separated by a space. ...
-2
votes
0answers
15 views

Looking for a windows batch text manipulation program [closed]

. This batch works fine in Windows. JREN.BAT 40.7 KB (41,720 bytes) version 2.8 Batch code: for %%F in ("%~dp0.") do call D:\Batches\JREN\JREN.BAT "^" "size(' ')+' bytes in ...
1
vote
1answer
50 views

Prevent deleted files from running in the Startup folder

I have a batch script in my startup folder called everytime.bat that deletes all files except for the batch script. @echo off REM delete everything in startup except this file cd "C:\ProgramData\...
1
vote
1answer
30 views

Batch file with Powershell command quotes

I have created a script to change my IP address/mask and VLAN ID of an interface but the problem is that in order to change the VLAN ID, I need to execute a PowerShell command. My variable containing ...
2
votes
2answers
110 views

Delete every subfolder in a directory that doesn't contain certain extensions

Question: Is it possible to delete every folder in a certain directory that does not contain specific file types for example music files (mp3/flac/wav/etc)? I've retagged some files using Mp3Tag ...
0
votes
1answer
31 views

Double extension file

i don't know from where I got this file in my computer's temp folder C:\USERS\xxxxxxxxxx\APPDATA\LOCAL\TEMP\TMPE8FE.TMP.BAT is it some kind of malware? if yes, then how should i resolve this.
2
votes
3answers
145 views

Delete files depending on positions/file name in the current folder / define multiple values effectively

How do I effectively delete several files depending on their positions(edit: or retrieve the files by their number) in the current folder? Preferably I need a solution with a normal .bat file. The ...
1
vote
1answer
166 views

Windows Batch For Loop Filenames with Exclamation Point “!” Problems

Exclamation Points are my bane with Windows Batch. Say I want to just skip filenames with an ! in them. I know for checking regular text in variables in a for loop, I can run: setlocal ...
1
vote
0answers
10 views

How get the disk transfer rate, in percetage usage, for cmd/batch? [duplicate]

I need to know when the hdd is a bottleneck, to improve my batch code on Windows 10 I am looking for a command line for cmd/batch similar to this one, but that helps me to know the disk load ...
0
votes
0answers
14 views

Task Scheduler Windows 10, repeats every 30min instead of 1h

I created a task for running a python script every 3 hours for 12 hours a day, starting at 9 am. Problem is that it runs every 30 minutes instead. I changed it to every hour instead but still runs ...
0
votes
0answers
62 views

Windows Batch Script and handling file names with “!” Exclamation point in For Loop

Part of my script I am having issue with is here: setlocal enabledelayedexpansion for /r %%a in (*) do ( cd "%%~dpa" set /A count += 1 set fn=file!count! %batchdir%\7z.exe a -mx9 -sdel -p"%password%"...
0
votes
0answers
20 views

how to run a master batch file from a taskscheduler?

@echo off start test1.bat start test12.bat start test13.bat start test133.bat exit /B 0 I can run that master batch directly in cmd but not through taskscheduler. All batches are from same ...
0
votes
0answers
42 views

reg save -> ERROR: The system was unable to find the specified registry key or value

I would like to save/backup all registry entries that accumulate over a while in a certain part of the registry. So far I have tried in the command window which I opened with admin rights: reg save ...
0
votes
0answers
40 views

how to find certificates using keyusage values

Experts, anyone know how to find certificates using keyusage values? I'm searching for my personal store certificates containing with specific keyusage values. any help? i wasn't able to find any ...
0
votes
1answer
77 views

Add a variable to a batch process

I'm using ffmpeg to rip some video files. I am looking to rip each video to a size of about 500 MB. To achieve this, I need the option to enter the video bitrate I choose for each individual file. ...
1
vote
1answer
131 views

How to recursive copy files from a list of files in a text file using a Windows batch file?

Parent folder: Root Subfolder1: Has 12000 files i.e. subfolder1\885.txt Subfolder2: Has 15000 files i.e. subfolder2\882.txt Source file list names.ext contains 500 different names: 882.txt 550.txt ...
1
vote
1answer
116 views

2-pass batch video encoding using ffmpeg and/or python

I have a large set of video files I would like to encode to smaller files on a Windows machine. I want to use a 4K constant video bitrate and copy the audio. I've settled on using 2-pass FFmpeg to ...
1
vote
1answer
163 views

Batch Script to Rename Files to Folder Names + Custom Text

I have found part of the solution to my problem via this Superuser answer, however I need the code extended to name the file in the format of: <folder-name>+<user-defined-text>.iso My ...
0
votes
2answers
49 views

PowerShell - Calculate and Output Folder Size 2 Folders Deep

I would like to run a PowerShell script to output the folder size two layers deep. I can do it manually with this: function Get-Size { param([string]$pth) "{0:n2}" -f ((gci -path $pth -recurse | ...
-2
votes
0answers
28 views

Multiple Start and Wait in Batch File

i have a main.bat where i want to start multiple bat inside simultaneously. start test2.bat timeout 2 start test2.bat timeout 2 start test2.bat after all this bat is finished i want to run another ...
0
votes
1answer
58 views

Using a Windows XP Batch script read in a list of filenames and then parse filename to create new filenames

I have a very old Window XP program that I want to automate a little. It takes three parameters: ITF.EXE <control-file> <input-file> <output-file> and it only accepts 8.3 ...
0
votes
0answers
19 views

Choose tesseract language when doing batch OCR with SubtitleEdit

I'm using Subtitle Edit on Arch Linux to convert some VobSubs (.idx+.sub) to SubRips (.srt). To do batch conversion I can use this command line: subtitleedit /convert 01.eng.sub subrip This will ...
0
votes
0answers
12 views

How to apply simple batch rename commands to files in all subfolders? [duplicate]

I have more than 100 files, each in a separate folder. I want to rename all those files with names of the respective folder. Usually, When i rename multiple files (all in one folder, no subfolders) i ...
2
votes
2answers
87 views

How do I get the current directory name in a windows command prompt inside of FOR loop?

I'm using Win-10 64-bit. Given the following directory structure on my windows machine... c:\tmp\Logs_UAT\ '-> folder1 | '-> test.txt '-> folder2 '-> test.txt ...I'm trying to ...
0
votes
0answers
23 views

Can I add an exception for a particular PID so that task does not gets killed by using taskkill

I have multiple instances of an application running on my remote server. I have created a batch file using taskkill to kill the processes. Is their a way through which I can add an exception for a ...
0
votes
1answer
98 views

How do you pass a number string to a program in a batch file

I'm making a batch file which runs ffprobe to get the length of a video file. this info is save inside a text file. I can then load that data into my batch file and remove the decimal places from the ...
0
votes
2answers
95 views

How to call a ffmpeg command only for the last file of a folder?

Here is my command, it's to cut he last 20 seconds of a video. ffmpeg -y -sseof -20 -i record.mp4 -vcodec libx264 -crf 27 -preset veryfast output.mp4 It works perfectly, but I would like to have to ...
1
vote
2answers
65 views

Running file from batch file

I am working in Windows 10. This is my code saved in .bat file: %windir%\System32\cmd.exe "/K" C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\activate.bat C:\Users\Alex\AppData\Local\...
0
votes
1answer
34 views

Restart Computers and Send a Log

I am in need of assistance. I'm trying to make a batch file to restart computers on my network and send a log of what computers successfully restarted and what computers were not. I know to restart ...
0
votes
0answers
81 views

Run script triggered by Outlook 2016 Calendar notifications

I am using Outlook 2016 and have certain calendar events scheduled. I would like to automatically run a script based on those scheduled events. The calendar event dates can shift or may get canceled ...
1
vote
1answer
91 views

Create a batch file to join two files with *similar names* and same extensions [Windows]

I'm currently attempting to take files: example.mkv // This is the source with audio/subs example-Encoded.mkv // This is video only/encoded source And set up a script. I have made a ...
0
votes
1answer
63 views

.bat file - TXT Log downloaded files, if its repeated, then delete

New code still not working :( please help me fix this @ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET "SEARCH_DIR=%~dp0FILES" FOR /F "tokens=*" "%%a" IN (log.txt) DO ( FOR /R "%SEARCH_DIR%" %%f ...
-2
votes
1answer
40 views

How to close the currently active window using cmd or batch command in windows 10?

I'm looking for a command that can close the currently active window or running application in windows 10. I know taskkill but this is different because here you can't specify the name of the active ...
1
vote
1answer
70 views

How to set low priority while compressing with wzzip.exe

I have this in batch and the code works without start /low. While compressing with wzzip the CPU is 100% and all other programs hang. So to fix this issue I've been trying to either set affinity or ...
0
votes
0answers
23 views

How to change colour scheme for batch files?

It's easy to change the cmd colour scheme or to use a tool to customise things to an extent. However, all batch files seem to open with the default colour scheme with no way to change even the ...
3
votes
2answers
645 views

ASCII code in batch file, doesn't seem to print right no matter what i try

echo██▓███ ▄▄▄ ██▀███ ▄▄▄ ▓█████▄ ▒█████ ▒██ ██▒ echo▓██░ ██▒▒████▄ ▓██ ▒ ██▒▒████▄ ▒██▀ ██▌▒██▒ ██▒▒▒ █ █ ▒░ echo▓██░ ██▓▒▒██ ▀█▄ ▓██ ░▄█ ▒▒██ ▀█▄ ░██ █▌▒██░ ██▒░░ ...
0
votes
0answers
47 views

Force Windows 10 to install automatic WSUS update

A Windows 10 PC is connected to a WSUS intranet server, like a lot of other PCs here which are functioning fine, but others do not receive WSUS updates. I've written .bat file to force remote pc to ...
0
votes
1answer
40 views

windows batch compare then skip utf  in first line of file

I would like list lines of file in batch and, in case of UTF file, skip "" characters in first line. @echo off setlocal EnableExtensions EnableDelayedExpansion for /f "delims=" %%a in (list.txt) ...

1
2 3 4 5
64