All Questions
Tagged with windows batch-file
1,306
questions
0
votes
2
answers
32
views
windows defender antivirus folder missing on local group policy editor
gpedit.msc was missing, i added it with using .bat
after restart i could enter to gpedit.msc but windows defender antivirus folder is missing
i need that folder to disable windows defender. pls help
...
1
vote
3
answers
140
views
Is there a difference between combining commands with & and running them one at a time?
Say I want to run multiple, computationally complex commands on Windows command line.
Does it makes a difference, performance wise, if I combine them with &:
doSomething1 & doSomething2 & ...
1
vote
2
answers
60
views
Sorting Windows Explorer's file checkboxes output
I'm writing a rough .cmd batch to do an operation with a few files (4 or 5) in Windows. I want to mark the desired files in Explorer's checkboxes, and drag-and-drop them to the batch file, that will ...
2
votes
1
answer
93
views
A batch file with an executable file checks if it is not in the processes in order to run another batch file (or code from it)
There are two batch files. Need to add a condition to the first file if the process is running nvcplui.exe then nothing, and if it is not running, then the second file (or the code from it) will be ...
0
votes
0
answers
53
views
Creating a bat file to force close microsoft excel
First of all, i am sorry if i post this in a wrong community as i am new to this.
So i am trying to run a bat file whenever something goes wrong, the code for the bat file is as follows:
taskkill /IM ...
1
vote
2
answers
127
views
Powershell in bat file closing console
I have a bat file that normalizes several audio files in one folder.
I create txt files with the same names as the audio files and I need to delete some lines from a txt file that will be used to ...
0
votes
1
answer
89
views
Why does an `echo` with brackets `()` break the `if` statement?
The if statement in following code shouldn't trigger, but it does. If I change echo () to echo [], it works as intended. So apparently it has something to do with the brackets ().
set a=1
set b=2
...
0
votes
1
answer
38
views
How to extract a part of a line that is between two specific strings using a batch script [closed]
I am trying to extract strings which are between <meta property="al:ios:url" content="snssdk1180://live?room_id= and " data-rh="true">.
Example Input:
<meta ...
3
votes
2
answers
507
views
Windows Batch Script: how to recursively go through all files except certain file types and folders?
I'm trying to do a replace string operation on all files except those in .git folder and all pycache directories which can appear nested in any nested directory. I'm executing the script in the root ...
0
votes
1
answer
87
views
Copy and rename batch file
1folder (cover.jpg)
2folder (cover.jpg)
3folder (cover.jpg)
.
.
There are so many jpg file with same name cover.jpg in multiple folders.
I am trying to copy and rename all cover.jpg in another folder ...
3
votes
2
answers
408
views
What Equivalent %* of Batch in PowerShell
Batch Script:
@echo off
if not "!!"=="" setlocal enabledelayedexpansion
for /f "tokens=4*" %%a in (
'dir /AD "%USERPROFILE%\" ^| find "DIR" ^| Find /...
0
votes
1
answer
32
views
If I created a task on a user called "A" and I want it to be executed on user "B", how do I do it?
I'm looking for help with "Task Scheduler" Windows 10
I don't know how to do it but basically, I have two users, "A" has admin rights and "B" does not.
I also saved the ....
0
votes
0
answers
36
views
Send input to running program Batch
I would like to start a cmd line program in Batch and be able to communicate with it.
Currently I am starting the program with start /b cmd /c "cli_program.exe" > log.txt. I am currently ...
0
votes
0
answers
29
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
2
answers
93
views
How can I echo the actual logged in user if running batch as administrator?
I would like to know which user is logged in to Windows from the bat script I launch with right click and "Run as Administrator". If I try echo %username% the script obviously output "...
1
vote
1
answer
61
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
130
views
Windows Terminal: Open cmd.exe then run script
I want to create .bat file to open cmd.exe in Windows Terminal and activate python environment
cd D:\pythonApp
venv\Scripts\activate
this successfully open cmd in Terminal and set the directory
wt....
0
votes
1
answer
252
views
(SOLVED) how to enable and disable device in one batch file [duplicate]
I want a shortcut that enable/disable a network card according to its status. I figured out how to enable or disable using either devcon, wmic and pnputil or found some Q&As here that suggest ...
1
vote
2
answers
199
views
Copy single file in to sub folders of destination root folder
I need to copy a single text file inside a (source) folder in to all (480) sub folders of another parent folder.
To keep it simple (I will amend the correct paths later) as I try to work out how to do ...
0
votes
2
answers
343
views
Xcopy: Copy last modified file from folder
I need to copy the last modified file of a particular extension from a folder. For example a folder contains:
File1.cas
File1.txt
File2.cas
File2.txt
File3.cas
File3.pptx
...
File100.cas
File100.pptx
...
-2
votes
1
answer
66
views
Improve bat script
I'm try to improving this and make it looks better. I have two issues
When I run as administrator the file that I need won't copy in the user profile (I just run as admin to run the .bat script.
...
0
votes
0
answers
105
views
Display switch with a timeout in a Batch script
I have my PC connected to my monitor and TV. I want to be able to switch my display to the TV and launch an application through a script.
As I do this, I would like to set the audio to be the TV ...
0
votes
0
answers
389
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, ...
1
vote
1
answer
99
views
Weird effects when one CMD script runs another, from inside a function
When one BAT or CMD script runs another (without call), that should not return, right?
It sometimes does!
And it searches the same function label in that other script?!?
Example: (what do you think ...
0
votes
1
answer
170
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-...
0
votes
3
answers
276
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 ...
0
votes
2
answers
250
views
Windows taskkill not finding titled cmd.exe
I'm starting a lot of .bats, in which I execute, for example:
title Waterfall-Proxy
I do this, to have an easier closing the right cmds when I want to shut them down.
To shut them down, I'm using:
...
0
votes
0
answers
152
views
Switch screen being mirrored by command line
In my setup I have two monitors stacked vertically, and a TV, hooked up to my PC. The TV mirrors the top screen usually. I want to write a script (so that I can set a keybind) to switch the screen it ...
0
votes
1
answer
2k
views
How to verify if a variable is equal to an other variable or a Windows variable in batch files?
I am making a "locked" batch file that only certain user can use so what I am doing right now is to check the condition if what the user write is == to %username% or other variable like this:...
2
votes
1
answer
665
views
MultiMonitorTool.exe questions
I am using Multimonitortool.exe to switch between displays, to be precise: i got 3 Monitors, while Monitor 1 and 2 are permanentely on and Monitor 3 is turned on only when i need it. If i need it, ...