50,338 questions
Advice
0
votes
2
replies
62
views
CSV file editing via bat file
I have a report CSV file that has some special characters in the header row. I would like to set up a short script in a .bat file to remove these characters, so i can schedule a task to automatically ...
0
votes
3
answers
109
views
batch renaming of numeric files
I would like to rename a bunch of files in a given directory that are already present in ascending order to another line of consecutive ascending numbers. The goal is to close gaps in between and get ...
-1
votes
0
answers
42
views
Jenkins is unable to locate the executable file after extracting the Nexus NuGet package
I attempted to execute the following command in a Jenkins batch script to run the executable named "GitFetcher.Exe," which is located within the tools directory of "IB.SO.AutoUtility.&...
-3
votes
1
answer
118
views
Why is the cURL command not working from the batch file? [closed]
I need to use cURL from the batch file (.bat) in Windows. My script is the following:
@echo off
curl "https://...url1..." -o "D:/path/file1.htm" "https://...url2..." -o &...
1
vote
3
answers
241
views
How to convert a batch to Powershell parallel processing to run over thousands of input files?
I have a large number of files (about 3800) that I want to run a program over. The program reads a WAV file and makes a short .TSV text file containing the WAV's lip-sync data (but that is by-the-by ...
1
vote
1
answer
96
views
Windows batch file cuts off file extension in for statement
I noticed that some software I use, AutoDarkMode, doesn't randomize the first wallpaper it switches to, so I thought I'd write a batch file to do it by copying one wallpaper in the folder and renaming ...
0
votes
2
answers
167
views
How to accurately extract a block of text with CMD BATCH?
I'm trying to output part of a file (the text enclosed between :begin(...) and :end(...) markers) using a BATCH script. The target is pure ASCII text but it may contain blank lines and symbols; the ...
2
votes
3
answers
226
views
Capture stderr separately in file while also including it in live output
Problem
Given some arbitrary process that may or may not output to both stdout and stderr, I need a way to execute that process on the command line in Windows that captures stderr on its own. I also ...
2
votes
1
answer
60
views
MediaInfo CLI; get item within a loop
I need to get the mediainfo item "Bits-(Pixel*Frame)" from every mp4 file of a folder.
If that item doesn't exists (It doesn't for all movies),
I will try to derive it from other items.
So ...
1
vote
3
answers
92
views
Windows cmd script to loop through subdirectories and call another script
I would like to write a simple Windows batch script that, given a directory containing a set of subdirectories, loops through them all and calls a batch script of the same name in each. The code I ...
-1
votes
1
answer
131
views
Execute arbitrary raw PS code including # comments and parentheses embed in a batch script [closed]
A single (hybrid) file can contain both Batch and PowerShell script without generating extra temporary files by leveraging the comment syntax of each language. This allows the Batch interpreter to ...
0
votes
1
answer
205
views
Not equal operator not working with WMIC command in for loop of batch file
I wrote this batch to get the number of active processes given a certain command line value, but the not equal operator I use in the query to exclude WMIC.exe itself doesn't work, and the batch ...
-1
votes
3
answers
164
views
PowerShell Find and Replace: Set Content not recognized when called within batch file [closed]
I'm attempting to do a simple find and replace using the Powershell Get-Content and Set-Content commands. In the Powershell terminal, I am calling the following expression:
(Get-Content test_file.yml) ...
3
votes
1
answer
66
views
Why is appending to User Environment Variable PATH without duplicating is not working for the last path in Windows 11 command line?
I looked through a few solutions here and found an almost working script to append to the user Environment Variable PATH without overwriting the existing path and not clutter it with system's EV's ...
2
votes
4
answers
201
views
How to write a line feed <LF> to a file?
The following Windows batch file sets the contents of the out.txt file to two ASCII characters, namely: X and <LF> (0x58 and 0x0A ).
@echo off
SETLOCAL
SET LF=^
set /p=X^%LF%%LF%<nul>out....
1
vote
0
answers
191
views
build.bat fails to find vswhere.exe and git describe when building MPC-BE on Windows
I'm trying to build MPC-BE, an open-source media player for Windows, using the instructions provided in Compilation.txt and the GitHub README, because I want to add some features to allow external ...
-2
votes
1
answer
254
views
Problem using Task Scheduler to run batch file silently [closed]
I have a scheduled task, which runs a batch file every 3 minutes.
This batch file checks the running task list, looking for a certain running task.
If the task is running, the batch file exits.
If the ...
2
votes
1
answer
108
views
cmd batch execution adds a space after echo
When I run a script, for example one that says
echo a>>1.txt
the command line interpreter adds a space; so in the command line, executing the above says
echo a 1>> 1.txt
And of course, ...
1
vote
2
answers
74
views
Batch file if condition to check file type failing under specific conditions
I have been at this for a few days and can't figure out why this is not working.
I had made this to run with lf file manager but I'm testing it from command prompt with file.bat test.mkv or file.bat ...
2
votes
1
answer
118
views
nested pushd does not popd in cmd, is this a bug?
see this example please:
C:\
..ex1\
....start.bat
....111\
......1.bat
......222\
start.bat:
@echo off
pushd 111
call 1.bat
popd
echo CD is wrong:%cd%
pause
1.bat
@echo off
setlocal
pushd 222
...
0
votes
1
answer
53
views
Call batch function fails with path containing spaces and double quotes
I have a function that calls a program, it is trying to run a pkzipc with a path parameter that has double quotes and spaces. I have tried to escape spaces and quotes in different ways as mentioned in ...
0
votes
1
answer
94
views
How to read only specific folders and sync data using winscp batch file?
I am trying to write the batch script but not sure how to check the below condition.
I want to read all 3-digit number's folders and the 'data' folder only as first level directory, and inside these ...
0
votes
1
answer
74
views
How to kill processes in javascript on web?
How do i run batch from the web locally?
I'm trying to kill a process locally (sas.exemy own file) but from web.
1
vote
3
answers
140
views
Reusable subroutine in batch file
Trying to figure out the syntax in a batch file subroutine so it could be reused with a passed parameter.
Main portion of batch file...
Set PC=THISISATEST
Call :ToLowerCase
Subroutine...
:ToLowerCase
...
0
votes
1
answer
132
views
Why does 'set /a counter=counter+1' work without using %% in a batch script?
in this code I think I have to write set /a counter=%counter%+1 but I just tried write it without %% and interestingly it works I don't how?! can anyone explain it
@echo off
setlocal ...