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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

Batch Script: Setting Default Terminal Application

Hello i have been trying to change the Default window terminal from terminal to Windows Console Host using batch i could not find any way online and i have zero idea how to do this the setting im ...
user avatar
0 votes
1 answer
33 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....
uingtea's user avatar
  • 101
0 votes
1 answer
24 views

Automatically closing ('OK'-ing) a Windows Script Host dialogue box from a batch script

I have an incredibly annoying problem where my Win 10 license keeps randomly deactivating for no reason. Sometimes it lasts weeks without doing it but recently it seems to be doing it every other day. ...
tbmmbt's user avatar
  • 1
0 votes
0 answers
13 views

Read git label in version format on Windows

I have the following bash script which read the last label from git which is in version format (1.2.3.4). git tag --sort=-refname | awk 'match($0, /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/)' | head -n 1 I ...
Tomas Kubes's user avatar
-1 votes
1 answer
25 views

Start .bat file via php

I'm using system('START C:\[address]\refresh.bat'); but when I start this I get: C:\[address]>git fetch 'git' is not recognized as an internal or external command, operable program or batch file. ...
user avatar
0 votes
0 answers
33 views

Why is my scheduled task only starting when I open the Task Scheduler?

I created a scheduled task in the Windows Task Scheduler (W10). It triggers on startup (or log in of any user, I am flexible there) and launches a .bat file. The task runs with the privileges of user ...
Reygok3's user avatar
  • 11
0 votes
1 answer
43 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 ...
user2048695's user avatar
1 vote
2 answers
56 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 ...
Bel's user avatar
  • 13
0 votes
2 answers
191 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 ...
Hemil Mehul Shah's user avatar
0 votes
1 answer
35 views

Bat file display

I have a bat file i have that shows me all networks i have previously joined and inputed passwords to. however my own home network the bat file does not display the last symbol of my password, which ...
Simon Wilson's user avatar
-2 votes
1 answer
49 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. ...
Daniel Jiménez's user avatar
0 votes
0 answers
61 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 ...
RemotelyController's user avatar
0 votes
0 answers
55 views

Converted BAT to EXE Now Path to Temp Not Local

After converting Test.bat to Test.exe the Test.exe not finding local input file 360_2016.mp4 and the EXE file CMD Prompt displaying its path is to TEMP not local directory/folder. The EXE file is not ...
CANJMP's user avatar
  • 23
0 votes
1 answer
38 views

Write batch file to remove lines starting with a set of numbers (eg. 19:) and save file to a new location

I'm trying to write a batch file to remove lines from a text file that start with 19:, 20:, 21: and 22: and then save the file to a different directory. What I've tried is: findstr /v /b "19:&...
Travis's user avatar
  • 3
0 votes
1 answer
56 views

Batch file with multiple commands

I have a batch file to start several programs. it has quit working. It starts the 1st 2 and stops. No error message. e.g. G:\KarenPwrTool\Replicator\PTReplicator.exe G:\FileManagers\VfileViewer\v.exe ...
yodar's user avatar
  • 11
0 votes
0 answers
166 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
1 vote
1 answer
56 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 ...
Klaus Hartnegg's user avatar
0 votes
3 answers
52 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
0 answers
49 views

Where are the Hardware Address / Device Files listed in Windows 10? (McAfee Solidifier CLI commands/Win10 in use)

Our company uses McAfee Solidifier to lock down our Terminal PC's. I've been looking to find the minimum required folder(s) to re-solidify in order to allow newly attached peripherals to work and I'm ...
k1dfr0std's user avatar
  • 113
0 votes
1 answer
137 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
0 votes
3 answers
178 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
0 answers
222 views

run batch file during Windows Setup from autounattend.xml

I want to run a batch file during the windowsPE phase of an unattended Windows setup, and the autounattend.xml works fine as long as I launch the batch file from its path like this: <...
likeeatingpizza's user avatar
0 votes
2 answers
292 views

How to close cmd windows when I execute a batch file

I tried making a quick RDP connection as a batch file with ID, password, etc.... And I found this article: How do I make a shortcut of a remote desktop connection and include the password? From user: ...
Chanil JEONG's user avatar
1 vote
1 answer
819 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
1 answer
379 views

How do I set Task Scheduler to execute Windows Service at __:00/15/30/45 am/pm from start up?

To be more precise, this is a failsafe that I am trying to create for my windows service. For information, I need my windows service to extract data from a server at 15mins intervals everyday. E.g., ...
Wyap005's user avatar
2 votes
2 answers
219 views

Powershell (windows 11) move files and rename

I am trying to write PowerShell that will allow me to clean up files and place them into folders and rename them to include a date in the filename, and once I work out the commands, I will script it. ...
psycoperl's user avatar
1 vote
0 answers
61 views

Can someone help me understand the answer to another post? It is related to making scripts in order to block websites for a work profile

I really want to understand what is written, because I sometimes have the same question as the person who is asking as well as to learn more. I tried searching for certain terms, but I ended more ...
Carl's user avatar
  • 21
2 votes
3 answers
590 views

Batch file running installation through intune

I have created a batch file that will run an installation through intune. it will install the application it will install the configuration file And I need to add a 3rd step, which would then add a ...
Braulio Cirilo's user avatar
0 votes
2 answers
95 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: ...
Deutsch - Musik's user avatar
1 vote
1 answer
368 views

Run a Powershell command from a batch script as administrator [closed]

I'm currently writing a batch script that needs to invoke a single Powershell command as administrator. The batch script is already running in elevated mode. I have tried the following but it fails ...
Flaver-D's user avatar
  • 165
0 votes
0 answers
84 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 ...
Precast Dragon's user avatar
1 vote
1 answer
336 views

What does a YT-DLP batch file for MS-DOS look like which accepts URLs which have been copied to the clip-board?

Please view the batch file below. The goal ... is to run yt-dlp in a batch file, which then gives you a menu with six options: yt-dlp "%temp_file%" yt-dlp -f best "%temp_file%" yt-...
GwenKillerby's user avatar
0 votes
1 answer
53 views

Move a given volume (size) of files

Need to move any given quantity of files from a given type (csv in example) from ./source to a ./target folder and that: the total size of all files moved is below a given value SrcMax files are ...
jt99's user avatar
  • 11
0 votes
1 answer
593 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:...
NTF espolion 307's user avatar
0 votes
2 answers
75 views

for delims comparing files

I'm totally not a programmer, but I'll need a .bat-script to do some stuff. One of them is comparing files.. I'll have 2 directories that have multiple zip-files, and need to compare them (with an ...
loki's user avatar
  • 1
0 votes
1 answer
41 views

Delete line with batch script when testing only the first 4 characters on the line

How can I search in lines in the batch file. And only if the first 4 chararcters start with SLUI or VRLP then the line must be deleted. Now I have the following commands in script, only the line will ...
Nico den Breejen's user avatar
2 votes
1 answer
258 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, ...
PBR91's user avatar
  • 23
0 votes
1 answer
82 views

Mounting dropbox as a network drive and running a batch file on it

I have Dropbox set as a network drive drive letter X: with all my channel logos and EPG Data Generator program and scripts for creating an XML EPG File for Tivimate. This drive also has the XML EPG ...
Thomas Stevens's user avatar
-1 votes
1 answer
350 views

Trying to generate a listfile for ffmpeg concatenation via drag and drop onto a batch file

Yeah so pretty simple question really, theres only 3 steps to the process: 1. Get alphanumeric listing by dragging and dropping files. 2. Edit the file list to match the following syntax/layout: file '...
imkira3's user avatar
  • 19
2 votes
2 answers
141 views

Is it possible to write a script to uncheck the turn off all unnecessary animations (when possible) checkbox

Whenever I use remote desktop to get into my computer at work, I always have to go to the: control panel -> ease of access center -> make the computer easier to see …and I need to uncheck the ...
Raintan's user avatar
  • 23
0 votes
1 answer
50 views

CMD Subroutine Won't Abruptly End My Program As Intended

In the event that oldfile.txt does not exist, running this cmd batch below, inexplicably ends up executing line 8, but I don't want it to! I want the program to call the CheckErrorCondition subroutine ...
ShieldOfSalvation's user avatar
0 votes
0 answers
1k views

Execute a Batch and Powershell Script on a Remote File Server

I'm telling you that I'm trying to figure out how to run a PowerShell script without having it stored on the computer. simply running it with some jse script and let the script know where the file is ...
brenda gomez's user avatar
0 votes
0 answers
325 views

Write powershell output to file from within batch file

Trying to write powershell output to file from within batch file. powershell -executionpolicy bypass -command "(get-date).addminutes(1).tostring('HH:mm')|out-file '$env:temp\newtime.txt'" ...
user3208239's user avatar
0 votes
2 answers
2k views

Using a .bat file how do I copy a file from its current directory to another directory?

I want to be able to have the batch file in any directory and have it copy the file to the specified directory. I have tried using: set path="%~dp0" copy "%path%\test.txt" "C:\...
arjeplog's user avatar
1 vote
0 answers
60 views

How to monitor and move files to different directories one by one and in sequence on Windows?

How to monitor when files are created and then move them to different directories one by one and in sequence on Windows? For example, I have files in C:\Temp File names are random like File545.tmp ...
God of Money's user avatar
0 votes
1 answer
48 views

Executing a script after every login / password entry in Windows

How can I schedule a (batch-) script to be executed after every Windows log-in (not only after boot-up, but after every screenlock + PIN-entry)? (Background: I want to code an automatic reminder to ...
Dan's user avatar
  • 21
0 votes
1 answer
222 views

Use WinSCP or any other program (cmd) to download from SFTP [closed]

How to use WinSCP or any other program (from command-line) to download files from SFTP with authorization key? This is for Windows versions 10 and 11. I am trying to download files from command prompt ...
Codename K's user avatar
2 votes
1 answer
449 views

Inexplicable “The system cannot find the drive specified.” How to solve it?

I'm creating a Batch file and it was working OK, then, suddenly, it started throwing an error that's making me scratch my head and reach the limit of my ignorance. I reduced the Batch file to the bare ...
Paulo Santos's user avatar
2 votes
1 answer
545 views

How to index into array with variable in batch?

I'm trying to process input arguments to a batch file, and I need to tie some paired arguments together before I call an executable at the end. I'm placing all the arguments into an array so I can ...
batchconfusesme's user avatar
4 votes
2 answers
831 views

How to run python from Windows cmd?

I make a lot of python scripts - like blah.py, in my scripts directory, which is in the path. I want to just type "blah" to execute blah.py. but when I do - the file opens in visual studio ...
Darren Oakey's user avatar

1
2 3 4 5
61