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
1 answer
2k views

Insert a newline with set parameter choice prompt [duplicate]

I am working on a script that asks the user for a choice, that then directs the user to another choice that will use set to place a parameter based on what they input. The choice has a prompt followed ...
Mr. Mendelli's user avatar
  • 1,259
0 votes
1 answer
4k views

how do I merge 2 images with the same file names into one in a batch process? Is there a prgram that can do this?

Can anyone help me here. I am trying to make a collection of DVD covers. I have multiple images for the different covers and multiple images for the different spine lettering. Each cover .jpg has the ...
Robin Levingstone's user avatar
0 votes
1 answer
200 views

Cut two sections from batch of MP3 files

I have a folder with several hundred MP3 files in it, and I want to cut two sections out of each file. It's the same spots in each file -- from 0'00.00–0'03.81, and then from 0'08.83–0'13.95. I'm on ...
spoko's user avatar
  • 140
1 vote
1 answer
507 views

How to batch remux audio of .MOV files?

I have about a hundred home video files that I am recompressing for archival purposes. I want to convert them all to x264 using HandBrake, but I have a problem with the audio. They all follow this ...
Dion's user avatar
  • 31
1 vote
1 answer
2k views

How do I get the number of frames in a video on command line?

I am trying to get the number of frames in a video with ffprobe on windows, but it returns N/A. for /F "delims=" %%I in ('ffprobe.exe -v error -select_streams v:0 -show_entries stream^=nb_frames -of ...
John's user avatar
  • 11
1 vote
1 answer
628 views

Batch file if exist is exiting the program when using %USERPROFILE%

Basically, I am making a server and I am helping my friends join it (Don't Judge just felt like a game of Minecraft lmao) so I wanted to make a .bat file to do it automatically (slightly) and this it ...
Prime Studios's user avatar
2 votes
1 answer
20k views

Converting a certificate from a .cer to .pem using powershell or .bat

I am trying to find a way to script converting a .cer formated cert to a .pem format either using powershell or cmdline native to windows. Does anyone have any idea how this might be done?
deathscythe272's user avatar
0 votes
1 answer
1k views

Batch Rename all PNG files in folders and subfolders

I am trying to rename all PNG files within several subfolders. See below for my explanation on what I am doing: What is currently in place: COMPANY SERVER1 (Random).png COMPANY2 ...
Rmuell01's user avatar
3 votes
1 answer
1k views

Query registry value that contains slashes

I am trying to grab the value of the registry key in serialcomm using this command: REG QUERY HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM which gives me: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\...
rookie's user avatar
  • 97
2 votes
1 answer
4k views

Batch Script to move and rename if existing

I have a folder that contains thousands of .pdfs each file named by a 5 or 6 digit account number. I have a script that will create a folder of the same account number and move the file into it. ...
callasabra's user avatar
1 vote
1 answer
136 views

Removal of duplicate PDF files based revision level in file naming system

I'm trying to create a batch, powershell, or anything a novice like myself could run easily to complete the following task. Any help would be greatly appreciated. I have a few thousand pdfs, in a ...
Rosco 's user avatar
  • 13
1 vote
3 answers
11k views

Split variable in 2 after the last dot

I need to cut variables in two smaller variables after the last dot. For example the variable "european.union" will be vara=european and varb=union I use the following code to accomplish this purpose:...
user avatar
2 votes
1 answer
1k views

Windows batch command to assign specific time/date stamp to files

I know how to assign the current time and date to a file using copy /b filename.ext +,, but how can I assign it a different time and date, as in this variable: set DateTime=01/01/1970 03:00 AM?
Wally Walters's user avatar
2 votes
1 answer
944 views

Batch to exe - invisible window

I turned a batch file into an exe file using this program: http://www.f2ko.de/en/b2e.php If I select invisible, how can I tell the program is running at all? I don't see anything even in task manager....
Gappy Hilmore's user avatar
4 votes
1 answer
13k views

Files with non-ASCII characters in file name in a Windows batch file

On a usual (Western) Windows computer, I have a file файл.txt with non-ASCII letters in the file name. How can I do the following from a .bat file? dir файл.txt ren файл.txt file.txt etc.? I ...
Alexander Gelbukh's user avatar
1 vote
0 answers
1k views

Windows task scheduler does not kill child process

My task scheduler task has got one action: Start application--> D:\test.bat The batch test.bat spawns a child process (for example): notepad.exe When I manually start this task and end this task, it ...
Peter's user avatar
  • 1,055
0 votes
1 answer
90 views

How can I recursively scan for folders using `IF NOT EXIST`?

I want to make a batch script that will recursively search for specified directories using IF NOT EXIST to throw an error if the folders can't be located anywhere. Here is what I have so far: IF NOT ...
Mr. Mendelli's user avatar
  • 1,259
1 vote
1 answer
2k views

Batch file WMIC command output as variable issue

I am trying to get an output from a WMIC command to set as variable, For some reason it does not work. Can someone assist. This is what I am trying to do for /f "tokens=*" %q IN (' WMIC /Node^:Comp1 ...
NirmalKD's user avatar
0 votes
2 answers
95 views

Windows CMD - open bat from outside including goto

so I have created this utility batch file, shows you all kinds of info, but I wanted it to start on startup of the computer. So I have added it to C:\Users\username\AppData\Roaming\Microsoft\Windows\...
Sam's user avatar
  • 107
2 votes
2 answers
3k views

How to add\remove "This PC" icon from Desktop using batch file

I want to use a batch file to add\remove System shortcuts such as "This PC" and "Recycle Bin" using a batch file. Is this possible? (Windows 8/8.1/10) I tried this link to no avail. The goal here is ...
havakok's user avatar
  • 151
0 votes
1 answer
2k views

split jpg images by given proportions (imagemagick)

I have a bunch of images scanned into jpg format. As you see in the pictures below, the cards are two-sided, when scanning I have placed 6 cards inside the scanner. First card's front side is ...
acman123's user avatar
  • 763
0 votes
2 answers
551 views

How to get user Local name?

How to parse or get Local name of user ? On windows log on screen My username is - Admin, but when I type net user Admin newpass It says there no user admin. When I go to Disk C > Users there wasn'...
user875630's user avatar
1 vote
1 answer
2k views

Find a string at the beginning of all lines in a file and save to another file

I have tried quite a few options with no luck for this task. I would really like to do this as batch file but my attempts fail to get the desired result. I have tried a lot of different commands with ...
JAH's user avatar
  • 23
2 votes
1 answer
42 views

Remove middle number from multiple files and copy

I have the multiple PDF files in the specific format in a specific folder and for those particular files I need to trim the middle number using bat file and move to the destination folder with the new ...
DINE's user avatar
  • 21
2 votes
0 answers
69 views

Can a Win10 GURU automate this solution for splitting videos upon resolution changes? [duplicate]

Can a Windows10 Guru help automate this? I have failed at automating Lord Neckbeard's solution in the following post: How to split video files upon detected change in resolution? (ie. recorded ...
EverT's user avatar
  • 81
3 votes
1 answer
9k views

How can I inject a newline by replacement with this script?

I have a batch script that can replace text, and I want it to replace strings that are followed by a newline of text below the original. An example would be as follows: Before: Old string After: ...
Mr. Mendelli's user avatar
  • 1,259
7 votes
2 answers
16k views

Get output of a CMD command and set it to a batch variable

I run this command to get name of groups: set "remotegroup=" for /f "skip=1delims=" %%a in ( '"wmic group where sid="S-1-5-32-555" get name"' ) do if not defined remotegroup set "...
Aria Fathi's user avatar
2 votes
0 answers
3k views

Change the wallpaper without delaying using batch file

Using the code down below, either I'll have to open the file a few times or wait for a moment till the wallpaper change @echo off reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t ...
Anuja Nimesh's user avatar
2 votes
2 answers
2k views

How to backup file from server and keep last n versions?

I am trying to create a batch script to backup an Access Db from a NAS Server to another server and keep the last "n" versions of that file (n is fixed inside the script), this script is going to to ...
Chico3001's user avatar
  • 274
2 votes
2 answers
891 views

How to mass merge videos with multipliable audio tracks down into one track?

I have a few videos I want to upload to YouTube but it turns out YouTube uses it first audio track which is completely quiet. I have one for VOIP, Desktop Sounds etc but I want them all merged into ...
Codingale's user avatar
  • 131
0 votes
1 answer
92 views

Why does my script throw an error even if it's successful?

I have made a template batch script that I can tell to carry out a function. I usually use it for pointing to files or locations, in this case, I want it to find and highlight a file and throw a ...
Mr. Mendelli's user avatar
  • 1,259
1 vote
1 answer
526 views

Extract zip files with the latest name in each subfolder

Situation: I have the following folder tree: Root\ doc1\ doc1-r000.zip doc1-r010.zip ... doc1-r051.zip doc3\ doc3-r000.zip doc3-r001.zip ... doc3-r012.zip ... docN\ ... docN-rM.zip where each ...
nonKreon's user avatar
0 votes
1 answer
133 views

Changing username password without login into user?

How to change the username password without logging into that user or without typing the password. Password should be in command or script vbs or bat So that command is not okay for me cause I still ...
qwqw's user avatar
  • 1
7 votes
1 answer
1k views

Multiple operations with pdftk

I am using pdftk to perform some operations on PDFs. Right now I am doing it like this: pdftk <files> OPERATION <options> output - | \ pdftk - <other files> OPERATION <options>...
masgo's user avatar
  • 2,244
3 votes
3 answers
2k views

How to get particular word next word as output from a text file ? using batch?

I have run the following command line, netsh wlan show profile MyWiFi-name key=clear >key.txt Output, key.txt Profile MyWiFi-name on interface Wireless Network Connection: ======================...
Philip's user avatar
  • 686
0 votes
1 answer
475 views

Why does an install batch not know that i have .net 4.7.1 installed?

So I am installing cosmos for vs2017 and when I run the .bat file it says I don't have .NET Framework 4.7.1 installed but when I installed it, it said the same thing. So I went to C:\Program Files (...
FlamingBurrito15's user avatar
2 votes
1 answer
703 views

Can I use this script to properly patch an executable?

I had some help with a text-replacement script recently and wondered if it could be used for patching purposes. I usually use HxD, and thought that if it's essentially a glorified notepad, what ...
Mr. Mendelli's user avatar
  • 1,259
0 votes
1 answer
57 views

merge pdf despatches onto template with terms and conditions on back and print from a batch job [closed]

I need to print hundreds of despatch notes. Need to create a despatch note template with terms and conditions printed on the back of the page, then pick up the raw data pdfs and merge onto template....
mary's user avatar
  • 1
-1 votes
1 answer
372 views

Batch file log text

I have the following in a batch file: ECHO ---------------- Copy to Test --------- >> "c:\Logs\Posted_%date:~-10,2%-%date:~-7,2%-%date:~-4,4%_%time:~0,2%%time:~3,2%.txt copy "C:\myfiles\OT*" "c:...
user872769's user avatar
2 votes
1 answer
3k views

Script to extract the last word in the last line of a text file

I am trying to extract the last word of a findstr results query The command I run findstr /i %1 x:\itlogs\who_when.txt | findstr /i %2 the results I get 12/02/2018 10:17:58     SmithS         ...
Chris Page's user avatar
0 votes
1 answer
182 views

Windows cmd: Differentiate "input command" with "result"

is there anyway for us to differntiate "input command" with "result"? As image below, I want to see these phase in other color (red maybe): The operation completed successfully. IPv4 Address. . . . . ....
Luke's user avatar
  • 1,410
0 votes
1 answer
279 views

Want to handle the error while deleting some files and folders

I want to handle the error if anything went wrong while deleting the files and folders via batch file. My target files and folders are on remote server not on the same server.. I tried with pushd, ...
Narayana Boominathan's user avatar
0 votes
1 answer
2k views

start /wait /d - not working

I am trying to create script that launches a game, waits till it closes, then runs one final command. Based on my research, I want to use the "/WAIT" flag but it doesn't seem to work :'(. Im on ...
FreeSoftwareServers's user avatar
0 votes
0 answers
224 views

How can I recursively rename files with this batch script?

I have a large sum of files within directories and sub-directories with a variety of names. Currently I have a script that can do part of what I need, but the script must be in the containing ...
Mr. Mendelli's user avatar
  • 1,259
0 votes
2 answers
2k views

Extract IP CIDR from a text file

I have a large text file like this: 103.195.100.0/22 ReliableSite.Net LLC 1,024 103.214.69.0/24 Gestion DBI 256 103.238.80.0/22 Cloudone Technology Company Limited 1,024 103.43.72.0/22 ...
Aria Fathi's user avatar
1 vote
1 answer
390 views

Change Wallpaper according to time

I need to open it on startup to change the wallpaper at day n night Dim objShell str1 = "C:\Users\AnB\Desktop\Texts\Projects\Project WallTime\Day.bat" str2 = "C:\Users\AnB\Desktop\Texts\Projects\...
Anuja Nimesh's user avatar
1 vote
1 answer
4k views

How do I unzip many files to new respective folders? [Win 10]

Given multiple zip files in a folder named 1.zip, 2.zip, ... how do I quickly unzip them all to folder '1', folder '2', ... in Windows 10 Pro? I am using a Surface Pro 4, though I also have a Windows ...
DBinJP's user avatar
  • 165
1 vote
1 answer
4k views

Execute a powershell command from batch

I need to split up a very long line in a text file (maybe hundrerd thousands of characters) into shorter lines (8184 characters) and a .bat cannot handle this task. However, I found a PowerShell ...
FatalBulletHit's user avatar
0 votes
1 answer
94 views

How to check the presence of a line in a string?

how to find a specific string in a variable environment %path% from the batch file ? I try so but it does not work echo ;%PATH%; | find /C /I ";*ffmpeg*;" and ECHO %PATH% | findstr /n /r "*ffpmeg*" ...
Pavel Fedorov's user avatar
1 vote
1 answer
142 views

How to delete filenames with similar partial name?

I have a bunch of filenames that are timestamped (down to the nanoseconds) and I only want to keep one file per second. For example, here are some file names: 11-14-29-033.jpg (which means that the ...
Hayley's user avatar
  • 13

1
32 33
34
35 36
80