Questions tagged [batch-file]
A batch file is a text file containing a series of commands that are executed by the command interpreter on MS-DOS, IBM OS/2, or Microsoft Windows systems.
904
questions with no upvoted or accepted answers
8
votes
1
answer
5k
views
Stopping a scheduled task with a batch file action doesn't stop the program running in the batch file
I have several scheduled tasks that each execute a (different) batch file. Each batch file calls into the same program, with with separate command line arguments. If I Stop a task while it's running, ...
7
votes
0
answers
5k
views
Robocopy loops/nests "Application Data" 29 times when copying "Application Data" folder on Windows 10
My goal here is to be able to back up my entire computer by using robocopy. My robocopy script keeps getting stuck here as you can see with the Application Data.
C:\Documents and Settings\All Users\...
7
votes
1
answer
3k
views
Get current working directory of another process
I have a PID, and I am trying to determine what the current working directory of the process is. I played around with wmic process for a while, but it doesn't seem to have the cwd available. Anyone ...
5
votes
2
answers
4k
views
Rasdial error 756 only solved by rebooting
I have a very frustrating issue with a VPN connection initiated with Rasdial.
I have computers (Windows XP Professional SP2) which serve as an unmanned field measuring devices. They automatically ...
4
votes
2
answers
8k
views
How to remove all line breaks from text file using Batch
I wanted to remove all line breaks from text file
Example:
FILE1 +
FILE2 +
FILE3 +
The output should be
FILE1 + FILE2 + FILE3 +
I can't find answers on search engine that can solve my problem that'...
4
votes
0
answers
756
views
"Filename or extension too long" for move, but it isn't
I'd appreciate some insight as this is driving me nuts.
I have a folder on a network share: \\host.example.com\Share\Path\Container1\Folder
I am trying to move that folder to a new location on the ...
3
votes
0
answers
450
views
Open email folder in Thunderbird (v102.7.1) using the windows command line
I'm trying to open a specific email folder in Thunderbird (v102.7.1), using the command line arguments.
I already found out that using thunderbird.exe mid:<MESSAGE-ID> will open the email with &...
3
votes
1
answer
1k
views
NirCmd volume control of certain applications from Volume Mixer not working?
So I use this app to mute microphone communication in Valorant.
But I also want to mute the game itself.
The devs of the game have separated these 2 so in Volume Mixer (SndVol.exe) they are 2 ...
3
votes
1
answer
4k
views
Cut off from beginning to key frame using FFMPEG
How to cut away a piece at the start of video from beginning to the next key frame?
I know the -ss option
ffmpeg -y -noaccurate_seek -ss 00:00:30 -i "%%~ni.mp4" -avoid_negative_ts make_zero -...
3
votes
1
answer
828
views
Batch - How to differ between Windows 10 and Windows 11 in future versions
In the past i was using the major/minor number received from the ver tool in case i need to execute OS specific commands. With the release of Windows 11 it looks like this wouldn't work anymore (at ...
3
votes
0
answers
247
views
How can I use the Windows Console to find out which processes on my computer are accessing the microphone?
I'd like to create a small Batch script that only runs my audio mixing software (NVIDIA Broadcast & Voicemeeter) if there's a program actively using the microphone. For this I need to somehow ...
3
votes
1
answer
1k
views
.bat files not executing when double-clicked
When I click a .bat file it gives me a message: "How do you want to open this file?" .
I expect a batch file to run a cmd for me, so even when I click an option to open the file with cmd it ...
3
votes
3
answers
6k
views
write .bat file and execute command based on input - windows
I have written a .bat file in windows. Which launch these url in browser
do some other task
START www.google.com
START www.microsoft.com
START www.apple.com
But the one I wrote is static which ...
3
votes
1
answer
872
views
How to get list of CLSIDs along with their associated COM Object names?
Searching for the ways to generate or get the list of CLSIDs, I found this link, that actually does it.
But it's rather incomplete in my opinion, the complete list would include CLSIDs with their ...
3
votes
1
answer
2k
views
Open a program and enter a command in it with .bat
First, I do not know how to work with this kind of thing, let alone programming, but this site has helped me build everything I've done so far, so I came to ask a question.
I want to make a batch file ...
3
votes
0
answers
1k
views
Setting a logon script on Windows 10 adds +15 mins to first logon
I have created a batch script to create new local users on a new Windows 10 machine. As part of this script, I assign a logon script to the new user using net user:
net user %usrnme% /scriptpath:TEST....
3
votes
0
answers
3k
views
find string from multiple files and replace it without creating new file
I want to find string e.g. "date" from my files of a folder which contains multiple ".c" and ".h" files in it and replace it with "date 24-April-2018" using batch file. what should do? Please see ...
3
votes
2
answers
3k
views
Robocopy: destination folder size is bigger than source folder size
I've backed up my windows profile folder to external hard drive with the following command in batch file:
robocopy %userprofile% %~dp0src\dest /b /mir /mt /r:1 /w:5 >nul
After the copy was ...
3
votes
0
answers
1k
views
How can I reproduce linux's `column -t` command equivalent in windows?
What is the equivalent command for Linux's column command in windows?
How can I reproduce column -t in windows?
I cant find anything related on windows batch file commands list.
any help is greatly ...
3
votes
3
answers
28k
views
Automate putty via batch and execute a command
I use putty everyday to login to a Linux session and execute some commands.
Now since I have a thought to automate this process, I would like some help to complete this process.
I have made a batch ...
3
votes
2
answers
8k
views
Windows task scheduler not triggering a task on Windows 10
I have a task that is supposed to run a script I made, every 10 minutes, but it just doesn't seem to trigger it.
In the task scheduler it says that next run time is in 10 minutes, but when the time ...
3
votes
0
answers
6k
views
Can't execute remote command using PuTTY/ Plink over SSH
Currently I am trying to run bat files call_putty.bat and call_plink.bat, but it isn't excuting the input commands in -m E:\CREATE_ONT.txt
When I remove -m E:\CREATE_ONT.txt, the SSH session is ...
3
votes
0
answers
691
views
How can I get ConEmu to open more than 30 tabs?
I have a .bat file which opens 100+ consoles, but I need them in new tabs.
Problem is, ConEmu has a max of 30 tabs. I can do this with regular cmd, but its 100+ new windows. I'd prefer them in tabs ...
3
votes
1
answer
2k
views
how to shift all parameters in a batch
The well-know shift command can be used to shift positional parameters in batch file, BUT it does not affect the special variable %*.
The shift command has no effect on the %* batch parameter.
Is ...
3
votes
0
answers
75
views
Printing pages to different feeds (pdf) WINDOWS
We are currently sending out letters that print:
Letter on letter-head (customized for recipient)
Instructions on regular paper (customized for recipient)
These letters are all sent automatically in ...
3
votes
2
answers
7k
views
Why I can't sleep my PC with a batch file in Windows 10?
Earlier I had Windows 8.1 installed on my PC. Then I installed Windows 10. I used to sleep the PC with the following code when I was using 8.1.
but it doesn't work with 10; a CMD window flashes only ...
2
votes
3
answers
196
views
Seemingly impossible to extract URL string in between two text delimiters from 100's of messy Google News Alert emails with batch
For years Google News Alerts has sent daily emails when certain words pop up in websites, tweets, etc. and these emails (in HTML and .txt format) have one unique quality: there is no easy way to pull ...
2
votes
0
answers
787
views
How to automatically disable "Allow computer to turn off this device" on all devices in Device Manager
I need to frequently go through most devices and disable this option (if the Power Management tab is available) for clients machines (Win10/11).
Don't mind how it's done, Powershell/batch/VBS/etc.
I ...
2
votes
1
answer
74
views
Need help echoing audio sound cards to a text file in a dos bat
I have 8 sound cards installed and am trying to create dos code to dummy echo all the sound card exact names to text file. But ffmpeg won't echo output to a file .
Here is what I have tried, and not ...
2
votes
0
answers
915
views
How to pass multiple automatic reponses to user prompts between batch files using powershell?
I am trying to setup a system that allows for users to be able to format a script that in turn calls other scripts or commands that they include in this script.
On Linux I have it working using:
cat &...
2
votes
0
answers
514
views
How to create a message-box in Windows 10 with the same style as shutdown message-box
I'm writing a .bat file and I want to create a message box with the style used when displaying shutdown messages, such as the screenshot below (obviously without saying "your'e about to signed ...
2
votes
0
answers
782
views
Adding execution time and progress bar to the desired number of executables on Windows running via a batch script
This is a follow-up question of my previous question. Many thanks to @iTwasnTme, the following script (my_loop_exe.bat) runs desired number of executables (EXE) on my Windows 10 PC (x64, 8 CPUs).
@...
2
votes
1
answer
153
views
ffmpeg : Not keeping original codec for Audio Track
I have 3 versions of the ffmpeg command and none of them are perfect... I am stuck.
Below are the examples I have and the issues I face with each version:
ffmpeg -i "%%a" -map 0:v:0 -map 0:a:...
2
votes
1
answer
602
views
Batch file to recursively mux .mp4 and .srt from different folders
There is a new trend in torrents to release TV and Movies as x265 .mp4 with .srt subs in a separate folder, following this folder structure:
Season1\title1.mp4
Season1\title2.mp4
Season1\title3.mp4
...
2
votes
1
answer
1k
views
How to fetch the IP address,subnet,gateway and dns servers from ipconfig /all using batch
I want to fetch IP address, subnet, gateway and DNS servers from ipconfig and store in a variable using bash script.
I have created below script but it is not fetching dns servers(below XXXX and YYYY) ...
2
votes
1
answer
419
views
Task Scheduler .bat file creating wrong folder, while manually running it creating correct folder
When I am running .bat file manually it is creating the right folder, but when same file I am scheduling and running through Task Scheduler it is not creating folder as expected.
Below is the main ...
2
votes
1
answer
2k
views
batch file to restart WIndows 10 in safe mode with (or without) network?
How can I create a batch file to to restart Windows 10 in safe mode with or without network? I see many solutions here and in other website, but I just want a batch file that I run and the laptop ...
2
votes
0
answers
50
views
How can I access Start Menu search functionality over RemoteApp?
I use RemoteApp on a daily basis for accessing remote applications using my local desktop window manager. This has worked very well for me, particularly while working from home during the current ...
2
votes
2
answers
1k
views
windows, run net stat to txt daily with date/time in filename
first time post.
was unable to find similar solutions on this site or others. need a CMD batch file to run "netstat -an" output to a text file daily with a unique file name so the day before ...
2
votes
0
answers
1k
views
Windows - how to deny permission for all users from writing into a directory
Every week, I have to take the backup of all the project files from SVN and put into my system and remove the write permission for everyone. So that it won't be changed accidentally in local system.In ...
2
votes
1
answer
143
views
Effect of running a batch filed as admin on included programs
Windows 10. I have a batch file that contains a number of
start xyz
to start various programs. Some of those programs must be run in admin mode.
If I create a shortcut to a batch file and set the ...
2
votes
2
answers
7k
views
Run a .bat file silently?
I have a .bat file I am using to control the volume of my monitor using DDC/CI. I was using nircmd to run it silently, but as of the newest version of Windows 10, that no longer works.
Below is my ...
2
votes
1
answer
161
views
How do I get this randomised copy/paste/rename to work in my Win10 batch script?
I'm trying to force Windows 10 to change the logon/lockscreen pictures every so often with our own company ones (corporate branding).
The following directory contains the Microsoft stock images:
C:\...
2
votes
1
answer
876
views
Windows change language changing shortcut via bat or powershell file
I am in need of a bat or powershell command to change the language switching shortcut in Windows (for example from Caps Lock to Left Shift + Left Alt. Is it possible to do something like this?
2
votes
2
answers
339
views
Create script to delete files in subfolders
Good afternoon,
I need to create a script to delete files older than 30 days from the Downloads folder for all users on a server.
I used the command below but it didn't work. Any idea what could be ...
2
votes
1
answer
2k
views
How can I get a program to restart itself, using a batch file?
I am using Windows 10.
I have a program that allows me to run another program when a particular event is triggered. I can specify a batch file, which the program does run successfully.
However, I ...
2
votes
1
answer
2k
views
How can I automatically kill unresponsive apps and games with a batch file?
Sometimes a game becomes unresponsive and I have to go into Task Manager and kill it, then restart it. It can be very annoying and time-consuming. While I know how to use taskkill and start an app ...
2
votes
0
answers
208
views
Once BAT is compiled into an EXE, I can't get embedded EXE's to run properly
I have created a batch file that lets me change the static IP Address or enable DHCP of my network adapters. It works wonderfully. I execute several EXE files written by Horst Schaeffer. They are Wbox,...
2
votes
1
answer
1k
views
Removing 3D Builder in Windows 10
I type this in PowerShell running as administrator to remove 3D Builder:
C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage
It works fine, but how can I write the line in a ...
2
votes
1
answer
2k
views
7zip recursive unzip working well in CMD but not in batch
I am using this command below to unzip recursively from the source folder(D:\cnosftp\) and put the extracted file in the same subfolder.
FOR /R "D:\cnosftp\" %I IN (*.gz) DO "C:\Program Files\7-Zip\...