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
33 views

To kill a CMD session

I use a batch file to countdown and need to stop this countdown process in another batch file. I've tried to use these, but they all failed: taskkill /f /fi "windowtitle eq countdown" ...
user avatar
  • 57
0 votes
0 answers
27 views

Batch Command to Search network Folder by date modified

I am attempting to find the most recent files in a network folder using a wild card. The code within the batch file is provided below. When the .bat file is executed it returns an error for /f %%f ...
user avatar
0 votes
0 answers
20 views

.BAT command shell script requires keyboard Enter to resume when PC wakes

Windows 7, 10, 11. I run a .BAT stats collector command line script (as administrator) in a loop that does a variety of things including delaying for 30 seconds with ping -n 30 127.0.0.1 > DUMMY....
user avatar
  • 1
0 votes
1 answer
45 views

ffmpeg insert video on top of other video

I am trying to add video on top of another video but don't know how. I am noob in ffmpeg can any one help. Code I have tried: ffmpeg -i C:\Users\harin\Desktop\test\c\10sec.mp4 -i C:\Users\harin\...
user avatar
  • 103
1 vote
2 answers
47 views

Close batch file after launch a program

I adopt this batch script to bring the already opened outlook program to forefront which works and the batch closes then. However the batch does not close itself when outlook needs to open newly. ...
user avatar
  • 57
0 votes
0 answers
19 views

Using FFmpeg Batch Mux different audio file with same sample video stream

I have some audio only file in folder as filename.ac3 and need to mux with sample video only stream(sample.vob) with all audio file in that folder. And need to get output as all different audio file ...
user avatar
0 votes
1 answer
58 views

Real-time progress bar on windows batch

Well, i'm very new for batch stuff.. i'm still learning while i'm writing a decryption batch. anyways, i want to make a progress bar while the command is processing but it seems impossible (at least ...
user avatar
0 votes
1 answer
53 views

How to get the lines between two specific lines [multiples times] in Windows Batch file from multiples files.txt

Need to extract contents between two lines from text file. Base on research on similar questions: Batch Script To Extract Lines Between Two Specified Lines A sample script is made SETLOCAL ...
user avatar
  • 1
-1 votes
0 answers
10 views

Create ten text files from single line text file with random human readable text inside [closed]

So I have two folders one with a list file and another folder where I want the output to go to. List File SOCIAL PHYSICS ENG EARTH CHEM BIO MGMT FINA OSCM PSYCH MATH GEOG I want to take 10 words at ...
user avatar
  • 1
0 votes
1 answer
31 views

sc stop winDefend/deleting MpCmdRun.exe access denied

I am trying to stop windows defender service as an administrator but I am getting access denied error. The intention is to remove "MpCmdRun.exe" file after stopping service. I tried changing ...
user avatar
0 votes
1 answer
29 views

What scenarios will cause 'net' command to return errors containing NET HELPMSG 2185, 2188 and 2192?

In https://ss64.com/nt/net-service.html, There are 3 errors that looked very similar "The service name is invalid. More help is available by typing NET HELPMSG 2185" "Invalid service ...
user avatar
0 votes
0 answers
28 views

Create a batch file to grab words from a list and create text files, add random text within those files and three digit random numbers to title at end

@ECHO ON :::Test file :::: Remove spaces SET FileList==C:\Users\katana\Downloads\Template\list.txt SET CreateFileDir=C:\Users\katana\Downloads\UPLOAD\ FOR /F "TOKENS=*" %%F IN (%FileList%) ...
user avatar
  • 1
-2 votes
1 answer
35 views

Looking for a PowerShell or other script/batch file that will replicate a video file over and over to fill an entire hard drive [closed]

Looking for a PowerShell or other script/batch file that will replicate a video file over and over to fill an entire hard drive. Is this possible? Every sector. Basically like a killdisk but instead ...
user avatar
1 vote
0 answers
24 views

Batch String Manipulation of a File in For loop [closed]

I want to manipulate a string with batch and save it as a new file name. Changing works if I let the changes do it outside of the for loop. I would like to have it in the loop though so that it is ...
user avatar
  • 13
0 votes
0 answers
17 views

AHK: Open folder or active it if opened

I'm using autohotkey and try to do this: Open download folder (Q:\Down in my case) or active it if already opened (subfolders don't count, for example still open Q:\Down if I opened Q:\Down\phvideos ...
user avatar
  • 245
0 votes
0 answers
23 views

How to install Vivado fully unattended on Window?

I'm trying to install Xilinx Vivado 2021.1 on a Windows VM (Win10 20H2) automatically / fully unattended. I have tried steps from Xilinx Installation documentation and also ask on Xilinx forum but ...
user avatar
0 votes
1 answer
35 views

If exist folder batch not working

Please help to rectify my batch code where goes wrong. The purpose is to check where the folder is then delete those files older than 180 days. When It runs, it does not pop up anything. @echo off ...
user avatar
  • 57
1 vote
1 answer
23 views

Re-Order pages of an 'Unbooked' PDF - Batch / GhostScript / PDFtk

Preamble: 'Unbooking' a PDF has been asked before. That said, I haven't found an answer to this specific part of the process. Thanks to extensive research and a lot of help from this site, I'm halfway ...
user avatar
  • 113
0 votes
0 answers
10 views

Is there a way to change "Playback through this device" option for microphones with a batch file?

I have earbuds and headphones that I like to switch between depending on how I'm feeling. I use virtual audio cables to split my audio for when I'm streaming/recording. Right now if I switch from my ...
user avatar
0 votes
0 answers
37 views

Select a specific Network Adapter on a Batch File

I am trying to create a batch file that will always select a certain network adapter. I can't figure out the code to select the right one without prompting the user to select which one to select. %...
user avatar
1 vote
1 answer
25 views

Unicode in batch

My question is simple. I need to put fancy unicode into a batch file. I already put chcp 65001 at the start. Here is my example code: @echo off chcp 65001 >NUL echo [✓] This is a correct line echo [...
user avatar
  • 23
0 votes
1 answer
28 views

Restore file modification time from backup

Due to some careless copy/zip/unzip operations, all files in a folder and its subfolders had their last-modified time updated. I would like to restore the correct file timestamp from an older backup. ...
user avatar
  • 618
1 vote
2 answers
38 views

How do I create a batch command to minimize the window of a particular program?

I'm using Task Scheduler to launch SoundID Reference.exe, a third-party program, 60 seconds after my Win 10 64-bit computer starts up. That's working fine. I would like to create a batch command to ...
user avatar
0 votes
1 answer
31 views

How to stop a batch file altogether from a child batch file?

I have a couple of batch files. One is the parent and others are children that are called by the parent. Let's say I have Deploy.bat that calls ExtractParameters.bat. In ExtractParameters.bat I want ...
user avatar
  • 21
0 votes
1 answer
63 views

Echo line to start of text file using Windows batch command?

This works to add the text my_new_text as the last line in all .txt files: FOR /F "tokens=*" %%G IN ('dir /b *.txt') DO echo my_new_text>> "%%G" Is there a simple edit that ...
user avatar
  • 395
1 vote
2 answers
36 views

How do I use two runtime variables to get an index of the other?

I am trying to write a script to read user input to make selections for an IP manager but I am having issues formatting 1 variable to be an index of the other. I have tried a lot of different methods ...
user avatar
1 vote
1 answer
58 views

How to launch a batch file in the same window?

I am working on a launcher that contains batch games. The batch file of the launcher and of the game are in the same folder. Like I said they are both .bat files. So it is obviuos that I can just run ...
user avatar
  • 23
0 votes
4 answers
43 views

How do I batch delete entire rows that do not end with forward slash in CSV file?

I have a CSV file that is too large because it contains file paths as well as directory paths. I need to modify it so it only shows the directory paths but not the files themselves. I'd like to know ...
user avatar
  • 676
0 votes
2 answers
37 views

Count number of folders to delete in batch

I need help to modify the batch script to count the number of folders to delete. I use the code to remove those folders with yyyy-mm-dd named. And I found a similar script in the forum and try to ...
user avatar
  • 57
0 votes
2 answers
108 views

If statement with negative variables

My input variable contains only negative values, -5.0, -10.0... which will be checked by an IF statement. When the variable is less than -5.0, eg. -4.9, -3.0,... an invalid value message will be sent. ...
user avatar
  • 387
2 votes
2 answers
278 views

Count variable characters with negative value

I have a variable (vLUF) in a batch file with a negative number, -5.0, and I need to get the number of characters it has. I'm using a command, posted on above link, but the variable "count" ...
user avatar
  • 387
0 votes
0 answers
20 views

Delete folders old than certain days [duplicate]

I want to delete some specified folders (named yyyy-mm-dd) with more than 10 days old but my script does not work. Please advise how to rectify it. REM Remove Folders Old than 10 days FORFILES /p “d:\...
user avatar
  • 57
0 votes
2 answers
47 views

Error running and killing then run new batch file on specific time period

Error running and killing then run another batch file on specific time period. Tried to run timeout and CALL simultaneously but I guess there's an error in my lines so it doesnt go through. Since my ....
user avatar
0 votes
1 answer
27 views

Running a certain task on putty

I have a task that I need to run on an almost daily basis. I was hoping if there was CLi or bat file to do the same. Task is: Open putty.exe connect to 192.168.0.2 typing "login as" details ...
user avatar
0 votes
1 answer
63 views

Send variable value in batch file to Powershell script

How to pass the value of a variable from batch to powershell? I'm trying to use the command from this link: https://stackoverflow.com/questions/6359618/pass-parameter-from-a-batch-file-to-a-powershell-...
user avatar
  • 387
0 votes
1 answer
34 views

Echo errorlevel description to log file

Forgive me ignorance here. I'm very new to writing batch files. I am copying files from one mapped server drive to a different mapped server drive, and creating a log file after the copy is complete. ...
user avatar
  • 1
0 votes
0 answers
20 views

Calling a routine inside if doesn't return value only the first time but later values are returned in batch programming

My question is that why doesn't the first returned value show or appear. Values are returned from second time and so on. This is a simple example of the problem. @echo off SETLOCAL=...
user avatar
0 votes
0 answers
21 views

How to change network connection to DHCP, as default user without administrator password?

I manage many remote Windows 7 and Windows 10 PCs that are logged on as standard users, where I log on to these via remote control program for necessary maintenance. The PCs are set up with a static ...
user avatar
  • 1
1 vote
1 answer
31 views

Add file name to beginning and line break at the end of file

I want to add file name to the beginning of every file and line break (-------------------------------------------------------) --> like this --> empty ...
user avatar
  • 113
0 votes
1 answer
31 views

How to make a batch file to find files in the current directory and operate

So I'm trying to make a batch to operate in different pc's so the directory is dynamic but the folder names in the directory will be the same. It moves some jpg images out of the 'Output' folder, ...
user avatar
0 votes
1 answer
50 views

Generating output file in folder without using copy command

I created a batch file that will read an audio in a folder, normalize the LUFS of the audio and generate the output audio in the same folder with the modified name, keeping the original file. The ...
user avatar
  • 387
0 votes
1 answer
33 views

Replace header row for all csv files in a specific folder and create updated file in another folder?

I will be getting csv files regularly posted to a specific folder. Whenever the files are posted, I want my batch script to modify the header values and create a new file in a separate location (...
user avatar
  • 3
1 vote
2 answers
34 views

Searching audio extensions in a folder

I'm trying to check in a folder of audio files that the mp3, flac and wav extensions DO NOT EXIST. If none of the three exist, I send a message that there are no audio files in the folder. I made a ...
user avatar
  • 387
0 votes
1 answer
49 views

Run script on windows startup with environment variable

Windows should run a script on startup that starts a DB based on an environment variable %SAPSYSTEMNAME%: net start SYBSQL_%SAPSYSTEMNAME% When i run this command in my cmd it works fine, however on ...
user avatar
0 votes
0 answers
46 views

how to detect user press right arrow key from cmd(.bat) or powershell and make if-else

if user press "right arrow key" i need to go to next page. if press "left arrow key" how can i detect if anyone pressing arrow keys and navigate them. Example: (if right arrow ...
user avatar
1 vote
2 answers
33 views

Connect if disconnected and disconnect if connected with batch [duplicate]

I'm trying to do a one-line batch command (for use with autohotkey with a keybaord shortcut) to: disconnect Wifi if it is connected: netsh wlan disconnect connect to SSID="MyWifi" if Wifi ...
user avatar
  • 1,696
0 votes
2 answers
44 views

how to make a batch file to edit specific parameters in another text file

i have a computer that streams on a close network, the stream is controlled by a text config file, i would like to make a bat scripts that goes like: enter your selected IP stream: enter your port: ...
user avatar
  • 1
1 vote
1 answer
24 views

xcopy only newest file to a subdirectoy

I have a batch file that runs when I build my solution in VS2019. The .bat file uses xcopy to copy .dlls from my project's Debug folder to another destination direction. I want to use xcopy to copy ...
user avatar
0 votes
0 answers
55 views

Recursively set Title property of all MP4 files based on filename in a folder and subfolders

I am looking for a way to set "Title" property of all MP4 files in a folder and subfolder based on the filename. e.g. It should change the title of "Sample Video.mp4" file to "...
user avatar
1 vote
1 answer
31 views

special characters in batch file

I downloaded Audio Device Switcher from Microsoft Store in order to quickly change audio device. Switching device inside the tool works well, however when I try to save command in batch file, I get ...
user avatar

1
2 3 4 5
73