New answers tagged

0 votes

Batch: start B once if R is running, not when R isn't running

Batch @echo off :checkifRocketLeagueisrunning SET /A "c=0" TASKLIST | FINDSTR /I "RocketLeague.exe" IF ERRORLEVEL 1 (SET /A "c+=3" & GOTO addtocount) ELSE (SET /A &...
0 votes

Batch: start B once if R is running, not when R isn't running

Here's some batch code that may give you a better starting point. If this doesn't work 100% for exactly what you need, it may be close enough so you can make it work. Rather than having routines use ...
0 votes

Batch: start B once if R is running, not when R isn't running

Use && instead of ||. The definitions are : && executes the second command only if the previous command's errorlevel is 0 || executes the second command only if previous ...
  • 417k
0 votes

What are valid characters for Windows' SCHTASKS command's task name?

Okay this was easy to answer: from a windows command prompt run SCHTASKS It will show you a list of scheduled tasks. Windows schedules a whole bunch. Here's some from my computer: Folder: \Microsoft\...
2 votes
Accepted

Playing several sequences from a video uninterrupted each after other with VLC, using windows batch file

Just give a try for this batch script and tell how does it works on your side ? @echo off set "VLCPathEXE=C:\Program Files\VideoLAN\VLC\vlc.exe" set "videofile=video_file.mp4" ...
  • 1,243
0 votes
Accepted

Trying to open a OneDrive directory file path using a batch file

When working with paths with spaces, you escape the entire path with quotes. So the first step you do is use explorer to navigate to the path you want to open in your script. You then click next to ...
  • 56.7k
0 votes

.bat file to change file and folder attributes makes my hard disc slow

The read-only attribute cannot be set to folders. Okay, not entirely true, yes, you can use attrib to set the read-only attribute to a folder, and then using attrib /d you can view that the folder has ...
  • 56.7k
0 votes

New to writing batch files, but need help constructing one to search for and delete all subfolders of a specific name

You can also do this with For /R [Folder] /D: @echo off for /r "F:\Temp" /d %%i in (*Subs )do echo\%%~nxi & rmdir /s /q "%%~dpnxi" Obs.: To ensure that the folder to be ...
  • 6,560
0 votes

Copy Mac Address of the most recent networking device inserted in my computer! Possible?

I don't know if this batch file that execute a powershell command can help you or not ? Just give a try and tell me if this what you want or you want something else ? @echo off Title Get MAC Address ...
  • 1,243
0 votes

New to writing batch files, but need help constructing one to search for and delete all subfolders of a specific name

I want to delete subdirectories named Subs within directories in F:\Temp The following should work: @echo off setlocal enabledelayedexpansion cd /d f:\Temp for /f "tokens=*" %%i in ('dir /a:...
  • 145k
1 vote
Accepted

How to LOCK computer after 'x' amount of time right after log on

Thank you for all your responses, each one of you gave me a piece to work with. Here is the completed answer: $i = 0 $sTime = 0; $day = (Get-Date).DayOfWeek if ($day -match "Saturday|Sunday"...
0 votes

How to run a Windows bat file that will allow me to connect and disconnect specific displays?

displayswitch has 4 parameters /internal /external /extend /clone At a guess, For 1 & 2 you want /extend For 3 only, use /external (provided 2 is not connected) I know /extend works but I don't ...
  • 301
1 vote
Accepted

Check if FileSize is over 10GB

I have a Solution which will work in this Situation. STRING OPERATION : SET /A sizeMB=%size:~-0,-6% SET /A maxbytesizeMB=%maxbytesize:~-0,-6% This is converting the larger numbers to smaller numbers ...
  • 916
0 votes

Running a bat file in ConEmu opens multiple command windows

It's hard to give a direct answer without knowing what commands are in your script, but in general, you can prevent ConEmu from opening a new terminal and instead cause it to open a new tab with the ...
  • 16
-1 votes

How to run a Windows bat file that will allow me to connect and disconnect specific displays?

Unfortunately, what you are looking for is outside the scope of a batch script - unless it is simply used as a wrapper for another executable. This functionality probably exists in PowerShell - check ...
  • 16
0 votes

MKVMERGE & cmd Batch Muxing Video and Subtitles

@echo off setlocal enabledelayedexpansion cd /d "%~dp0" && 2>nul mkdir "%~dp0temp" set "_mkv="C:\Program Files\MKVToolNix\mkvmerge.exe"" set "...
  • 6,560
0 votes
Accepted

MKVMERGE & cmd Batch Muxing Video and Subtitles

So someone on another forum came up with an answer that works for me: @echo off set /a "outernum=0" for %%m in (*.mkv) do set "output_name=%%~dpmtemp\%%~nxm" & set "...
  • 1
0 votes

MKVMERGE & cmd Batch Muxing Video and Subtitles

You don't need to loop over the .mkvand over the .srt files. Just loop over the .mkv files and let the script search for the matching srt (easy, as the .srt starts with the same title). Untested, so ...
  • 1,443
2 votes

How to run a Windows bat file that will allow me to connect and disconnect specific displays?

Try https://www.nirsoft.net/utils/multi_monitor_tool.html Run it and read monitors id and serial number columns. Then you may enable/disable monitors like MultiMonitorTool.exe /enable ...
  • 340
0 votes

Possible to use & join Long Path Variables in Batch file to call an EXE with those longer variables as command-line arguments? How?

rem from another variable set "add_path=C:\food\foo bar" set "path=%add_path%;%path%" rem ..mode simple append to path set "path=C:\food\foo bar;%path%" See also https:/...
  • 11
0 votes

Make old icon disappear from system tray automatically after SpeedFan restarts

The following batch will move the curer over the icons and the ones from programs that have exited will be removed: Look at https://www.nirsoft.net/utils/nircmd.html for free functions. SET "...
0 votes

Clearing past undo action menu (Undo Rename, Undo Delete etc) Windows 7

I also want something to clear undo history but not found any software to do that. Use delete file > empty recycle bin. As I known, Windows will be clear undo history if I delete some file(s) to ...
  • 232

Top 50 recent answers are included