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
1 vote
1 answer
53 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 ...
Bricktop's user avatar
  • 313
0 votes
1 answer
17 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 ...
Fernando Lisa's user avatar
-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 ...
user3520554's user avatar
1 vote
1 answer
110 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 ...
RPhZach's user avatar
  • 11
0 votes
1 answer
80 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 ...
mrhndsm's user avatar
-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 ...
George Bunkall's user avatar
0 votes
3 answers
136 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 ...
Rootz's user avatar
  • 13
1 vote
1 answer
61 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 ( ...
Sam sh's user avatar
  • 21
1 vote
0 answers
38 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 ...
Matias Squartini's user avatar
1 vote
2 answers
54 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) ...
TechHorse's user avatar
  • 347
0 votes
1 answer
28 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 ...
ThEnGi's user avatar
  • 1
0 votes
0 answers
32 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 ...
fomt's user avatar
  • 3
8 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 ...
Bricktop's user avatar
  • 313
-2 votes
1 answer
106 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 ...
Shane Cusack's user avatar
0 votes
1 answer
96 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]...
Darbas Darbas's user avatar
1 vote
2 answers
82 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 ...
GenShira's user avatar
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-...
midnightfm's user avatar
0 votes
1 answer
51 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%&...
Fjorstut's user avatar
1 vote
1 answer
224 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", ...
Xavier Poinas's user avatar
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, ...
query-01's user avatar
0 votes
1 answer
101 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 ...
Retsied's user avatar
0 votes
0 answers
46 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 ...
OW2 Is Trash's user avatar
0 votes
0 answers
18 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, ...
query-01's user avatar
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. ...
Fjorstut's user avatar
0 votes
0 answers
77 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 ...
Jim's user avatar
  • 11
1 vote
1 answer
103 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\...
ChrisH's user avatar
  • 11
-1 votes
1 answer
35 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 ...
Sevanna's user avatar
1 vote
1 answer
128 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-"...
Matija Succi's user avatar
1 vote
2 answers
161 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 ...
Ron's user avatar
  • 19
0 votes
1 answer
280 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 ...
Ron's user avatar
  • 19
2 votes
1 answer
209 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 ...
kerstoff0mega's user avatar
0 votes
0 answers
142 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 ...
OW2 Is Trash's user avatar
1 vote
1 answer
101 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\...
Gabe's user avatar
  • 13
1 vote
2 answers
140 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 ...
Hemil Mehul Shah's user avatar
0 votes
0 answers
32 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 ...
MyProgramSucks's user avatar
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 ...
owais owais's user avatar
6 votes
4 answers
551 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 ...
typecrazy789's user avatar
0 votes
2 answers
77 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 ...
MonkeyNoodles's user avatar
2 votes
1 answer
309 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 ...
andio's user avatar
  • 283
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 ...
SYSTEMSD's user avatar
0 votes
0 answers
229 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, ...
Al So's user avatar
  • 1
0 votes
3 answers
61 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 ...
daf0555's user avatar
0 votes
1 answer
141 views

"dir like" sorted by time in a batch file (.bat) using a piped string command: Get-ChildItem | Sort-Object -Property LastWriteTime, not working

I'm trying to build a trivial batch file in Windows for command line to execute a "dir like" command to list the directory contents sorted by time, avoiding typing: Get-ChildItem | Sort-...
nostromo's user avatar
1 vote
1 answer
289 views

Press any key to exit in command prompt?

I have an autohotkey script that runs cmd to check the hash for the selected file. I use certutil command for that task. #h:: hwnd := WinExist("A") for Window in ComObjCreate(&...
medukia's user avatar
  • 33
0 votes
3 answers
200 views

Batch script to take first & second part of folder name and create new folders from them

Any wizards out there that can help with this? I have some music folders labelled like this "Taylor Swift - 1989" etc with just the music files and folder image in the one folder. I need ...
Shane Cusack's user avatar
0 votes
2 answers
163 views

How to Batch Rename Photos but Keep Same Numbers

I've been researching this for over an hour now. Bottom line is I want to keep the NUMBER when I rename the photos. Nearly every app or process wants to rename all photos starting with (1) or 1 or ...
Ayemac's user avatar
  • 3
0 votes
1 answer
167 views

Move files from local to network drive without stealing away focus on production computer

I am looking to move files from local computer to network drive as repeated task once every 24 hours. I have tried couple of things but they all end up stealing away focus on the application as the ...
TSS's user avatar
  • 1
1 vote
1 answer
1k views

Disable Microsoft Edge Restore Pages Functionality

I scheduled a batch script with Task Scheduler to routinely close and reopen Edge to my website once a day while the browser is opened in Kiosk mode. I have: Taskkill /F /IM msedge.exe :: wait three ...
sushi's user avatar
  • 115
0 votes
2 answers
206 views

Batch file where to get date as MM.dd.yyyy for backup folder name [duplicate]

In below code I want to create a daily wise folder with hostname for backup where the date format shall be MM.dd.yyyy. I'm using set mydate=%date:/=% and Echo %mydate% to get thedate. But I'm getting ...
Babeesh Bhaskar's user avatar
0 votes
1 answer
90 views

Windows batch filename generator not running where am I going wrong?

I'm writing a windows batch script to take a .csv as input read data in each row as variables and output unique filenames to a new .csv in Windows batch script. I'm doing this to create an inventory ...
Gamma5779's user avatar

1
2 3 4 5
80