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.
3,974
questions
0
votes
0
answers
10
views
How to align spaces in CMD code output
My Batch code:
@echo off
set phones="iPhone 12" "Galaxy S5 4G" "Nokia 7"
set manufs=US "South Korea" Finland
SetLocal EnableDelayedExpansion
set n=& for %%a ...
0
votes
0
answers
8
views
Batch script and get the output value of a found key
All works fine in a CMD prompt, but, I need put in a bat file to run, but cannot get the output of the Reg Query cmd, and then run another query from that.
Since what I am looking for is an App ID, ...
1
vote
1
answer
26
views
How do I show parts of a string?
@echo off
set keys=_ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
SetLocal EnableDelayedExpansion
from keys above, command echo !keys:~1,1! output A, command echo !keys:~4,1! output D.
my question:
How do I ...
1
vote
1
answer
35
views
How can I check that files match a list of MD5 checksums on Windows 10?
I downloaded a large number of files via magnet:?xt=urn:btih:5f96d43576e3d386c9ba65b883210a393b68210e&tr=https%3A%2F%2Facademictorrents.com%2Fannounce.php&tr=udp%3A%2F%2Ftracker.coppersurfer....
0
votes
1
answer
48
views
Batch file running in one account but not another
I wrote a batch file to run a schtasks for a Windows 7 Home machine. When I tested it in my account (standard user), the script runs correctly, but when I migrated the script to the account (also ...
0
votes
0
answers
23
views
Trying to find .exe over multi drive wide search in a bat file. Tried with relative path commands
As stated in the title I have a bat file set up to locate and run 2 separate exe's. One is located in the same folder as the bat file which for this %~dp0 works just fine. The second exe is one to a ...
0
votes
0
answers
23
views
How do I modify certain node(s) and its attribute(s) XML files from command line without Powershell? [closed]
I have quite bunch of XML documents and need to perform rather minor modifications on them in batch mode. Of course I can simply write VBScript interfacing MSXML and use its DOM, but is there some ...
0
votes
0
answers
52
views
How to kill process if description name = "app for devs"? [closed]
How to kill process if you have it description name? I have description name like "app for devs", how can I check if app with this description is running, and how to kill it using batch or ...
1
vote
1
answer
54
views
Any way to do a Batch file move operation only when the HDD is idle-ish?
I know how to check if a specific program is running like winrar which might indicate usage on drive d: but is there a better way to determine if a drive is relatively idle enough (via Batch or other ...
0
votes
1
answer
28
views
batch findstr not working with string saved in a variable
I'm trying to find a string inside a file.txt using findstr and I have the following issue:
set "log_file=C:\Tools_Dev\log_file.txt"
a-findstr C/:"text to find" %log_file%
works ...
-1
votes
1
answer
22
views
how to store a variable and reuse it later within the terminal?
In a normal cisco switch if I run the following command:
copy running-config tftp:
the switch will ask me for a IP address.
for my plink I have this:
plink -ssh userhere@IP -t copy running-config ...
1
vote
1
answer
124
views
Batch files run through Task Scheduler aren't working as intended
This is the code I am using. It is something I found on other posts on this site.
Script Code #1:
@ECHO OFF
SET EXEName=TcpSnd.exe
SET EXEFullPath=D:\ComputerRX\Pharmacy\TcpSnd.exe
SET ...
0
votes
1
answer
92
views
What secure erase in the fastest way on Windows 10 with cmd? [duplicate]
I have a program in QT, C++ and I want to secure erase the computer after a trigger. After this process, I do not want the old data on the SSD to be accessed by data recovery programs. I want this ...
-2
votes
1
answer
64
views
How can I improve my Windows Batch File that merges two PDFs into a separate folder to move the PDF regardless of whether a merge exists
I have a windows batch file that merges PDFs from two separate folders and dumps them into a 3rd folder. One of the PDFs is a PDF of a map survey and the other are any accompanying photos the surveyor ...
0
votes
3
answers
150
views
What's wrong with this batch code?
Can someone help how to find whats wrong with this code?
Basically its only a part of the script i made to fix somethings and i can get the result of "DCHP Status" gives a blank result or ...
1
vote
1
answer
65
views
Batch file to output MD5 hash to a text file starting at a specific directory
@echo off
set "src_dir=C:\Users\\Documents\projects\Config\ABC"
set OUTFILE="C:\Users\Documents\Scriptoutput.txt"
echo %OUTFILE%
pushd %cd%
cd %src_dir%
for /r %%f in (*) do (
...
1
vote
0
answers
40
views
Bat file move files
I need to create a bat file to move files from folder 1 to folder 2. however, I need to keep in folder 1 the files created in the lasts 3 hours. all the rest old files must be move to folder 2. I´ve ...
1
vote
2
answers
56
views
How to wait until a Batch file operation has completed before redirecting its entire output to a text file?
It is easy enough to redirect output to a text file with a >. For example:
for /l %%n in (1,1,10000) do (echo %%n>>output.txt)
Ot alternatively:
for /l %%n in (1,1,10000) do (call:sub %%n)
...
0
votes
1
answer
32
views
Double SSH then execute NC using Batch file and Plink
Good morning,
I need to execute a netcat command and get the output to do elaboration on my local PC (windows). I just need the "connection good/bad"
Now I use PuTTY using the following step
...
0
votes
0
answers
33
views
ffmpeg batch doesnt work all of a sudden
I have a batch script that has always worked, but after I formated and installed Windows 11 it doesnt work anymore, tried it on another Windows 10 machine, doesnt work there either so I must be ...
7
votes
3
answers
4k
views
How can I skip a cycle in a FOR loop?
I am running a Batch script for processing some files. When it determines that the current file needs no processing I would like to skip the rest of the commands for that file and move directly to the ...
-2
votes
1
answer
108
views
Batch script to re-size JPEGs in music folder to 350x350 and delete unwanted files
I currently use a script to rename music folders from eg. Taylor Swift - 1989 to a new folder Taylor Swift with a subfolder 1989 with all files moved into it.
I've also added a rename line to change ...
0
votes
1
answer
126
views
How to add a numerical password in BitLocker? [closed]
I want have on PC add a numerical password. What should I do?
Because how much I searching for information can't find any specific. Any advice?
Because in other device:
Volume C: [Windows ] [OS Volume]...
1
vote
2
answers
106
views
Passing a variable to a variable within a batch file
I'm grabbing a value from the registry assigning it to %%b and trying to pass %%b to another area within the batch file as shown below.
But it comes out as %b.
It does not pass the variable a second ...
1
vote
0
answers
57
views
Merge specific files with MergeMKV
I've been using MKVToolNix GUI for a while and lately I've been utilizing its scripting functionality. I have some TV show files that I ripped and it's one of those shows where they contain 2 sub-...
0
votes
1
answer
52
views
Complex escape coding in a batch for-loop
Reference is made to https://superuser.com/a/1508668/1884857
In my code I have added Vomit IT's code into a for loop. However, the code stops at the line:
ECHO [int]$Calculation.split("%MathType%&...
1
vote
1
answer
298
views
How to convert Samsung's motion photos to still photos?
I've taken a bunch of photos on my Samsung Galaxy phone after inadvertently activating the "motion photo" mode, which captures a short video clip before and after the "click", ...
0
votes
0
answers
41
views
Batch file output redirection to a text file; not complete
Examples:
Parent-Dir= 'USA zip-code', Sub-dir(s)= 'yyyymmdd'
Example filename= 139_7_IPC1_NVR16-8580_20230101104640.jpg
There are six-hundred and ninety-nine files in the directory-tree that the, ...
0
votes
1
answer
109
views
How to Batch Apply Multiple Commands? FFmpeg
I have three commands that I've got to work individually for a set of videos, but cannot get them to apply together. I need to apply all three of these things to every video.
1) add audio, 2) speed up ...
0
votes
0
answers
48
views
Batch Enable "Hide HDR Notifications on this device"
I am trying to programmatically hide hdr notifications that recently got added to the xbox game bar in the last year or two. I tried enabling and disabling it through the ui and looking under these ...
0
votes
0
answers
19
views
Robocopy /MOVE, directory\tree not recreated, Win-11\Home
The line below previously worked with Win-10\Home; dir\tree remained intact.
robocopy D:\ A:\Bak_Up /E /ZB /dcopy:dat /LOG:A:\Bak_Up.log /TEE
By comparison, using Win-11\Home from the below .bat, ...
2
votes
1
answer
80
views
Using ffmpeg inside batch for-loop disables use of ANSI Escape colors
I am trying to use ESC codes to add coloring of text in a script to do batch processing of video files in a filelist.
In below code line 29, the ffmpeg code, is causing the later coloring to cancel. ...
0
votes
0
answers
92
views
How to minimize a running bat without using another one for that action
I am using a Window Manager program that won't run at logon even though the "start when Windows starts" box is checked.
I put it in the startup folder and it starts when I logon but the ...
1
vote
1
answer
133
views
Writing a batch script to copy files based on date
I have a folder on a local PC that updates files through Dropbox. I have created a batch script that runs through a scheduler each day.
So far it checks to see if a folder is empty (C:\TheGlenFTP\...
-1
votes
1
answer
37
views
What is causing the xcopy file from having an error in it?
I am new to xcopy. I am trying to move a file that is in excel format to a new destination and as a csv file. I have to do this so that the DMExpress ETL job can move the file and then read it. This ...
1
vote
1
answer
136
views
Running batch commands in AutoHotKey
I am on AutoHotKey and I'd have to run an application via batch command. The command is quite articulated, it has the form of:
" -path of the application- " " -path of a text file-"...
1
vote
2
answers
165
views
How can I put 2 different texts of 1 color each in a BAT file?
How can I put 2 different texts of 1 color each? Because when I tried to put, for example // color B to a text and then I put color A to another text, I took color A, which was the code below and the ...
0
votes
1
answer
371
views
How to get ASCII art text to be displayed when I opened my .bat file?
I wanted this ASCII art text to be displayed when I opened my .bat file, but the only thing that happens is that when I open the .bat file it closes instantly and I know that it is a problem with how ...
2
votes
1
answer
211
views
How to sort lines in files by custom order?
How can we sort content within a large number of files based on the first word encountered on a line before a separator? In a custom sort order.
I will explain this with examples. Say I have hundreds ...
0
votes
0
answers
184
views
Disable Or enable Tamper Protection using start windowsdefender: scheme
I recently read you can enable real time protection by using:
start windowsdefender://enablertp/
I want to enable/disable Tamper Protection from a batch script using the same concept.
I've tried ...
1
vote
1
answer
143
views
Batch file getting "The system cannot find the path specified"
I have been working on helping to resolve a batch file error per the title. It is attempting to run an .exe and output a file to a UNC, but keeps failing to find path specified.
"C:\program files\...
1
vote
2
answers
164
views
Exclude files with no extension - XCOPY or ROBOCOPY
I am trying to build a script that can copy folders, subfolders and contents from one drive to a backup drive. There are several files in each folder, subfolder. The condition I need to meet is that I ...
0
votes
0
answers
33
views
How to open the windows 10 keyboard with a batch file on tablet mode without minimizing current window?
I have a .bat file with the following:
start OSK.exe
This opens up a keyboard. Now the issue is that this batch file is ran when the PC is on tablet mode. Unfortunately this causes the current window ...
0
votes
0
answers
158
views
How to move video files to separate folders by filtering occurrence 01-03 in filenames for respective folders?
Need to move video files to separate folders with a batch script.
Actually I have thousands of video files dramas so need to move each drama to separate drama folder with every drama is 40 episodes at ...
6
votes
4
answers
561
views
How to get Paul Black's random file selector batch script not to select itself
I've been using Paul Black's random file selector batch script for a while to handle one aspect of playout on our radio station - and most of the time it works perfectly.
Except on occasion it adds ...
0
votes
2
answers
78
views
Some image files are deleted during output/moving with batch file
I've been having an issue for a while now with various versions of a batch file script I have been using to assist with listing items on my WordPress/woocommerce page. The script seems to occasionally ...
2
votes
1
answer
336
views
create symlink to a batch file
I create a symlink to my .bat file (test.bat)
mklink /D mycode test.bat
The problem : the symlink won't be recognized as program that I can run :
'mycode' is not recognized as an internal or external ...
0
votes
0
answers
55
views
Batch script text based game input crashes?
I'm coding a text based game using batch script, and I coded it so specific inputs lead to specific things, but when I'm testing and I input one of the commands that I know is supposed to work, the ...
0
votes
0
answers
254
views
Running a batch silently, but how can I get process ID to show a specific name?
I have followed this here to run a batch file silently, in the background and doesn't show on taskbar, it's great.
How to run a batch file without launching a "command window"?
The thing is, ...
0
votes
3
answers
64
views
Batch (or some other file) to have scheduled in Task Scheduler for a popup that leads to a website
I am trying to create a batch file (or some other file) to show a pop up reminder with a yes/no option that I can get set up to run at a designated time in task scheduler. This will be planned to run ...