All Questions
374
questions
2
votes
4
answers
12k
views
how to run a single command multiple times with a BAT on CMD
I tried to run the code below, but it gives a prompt. I want the batch file run the command "keygenerator.rb" multiple times.
@echo off
:x
:start
"C:\Ruby30-x64\bin\ruby.exe" "...
36
votes
4
answers
10k
views
Why does this batch file fail on a "REM" line?
I refer to question Add text to end of filename (but before extension) using batch file as I have the same problem. Using Windows 7 32-bit Enterprise (I know, I know ...) with all updates I wrote a ...
3
votes
3
answers
7k
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 ...
0
votes
1
answer
859
views
How to set batch file output to be the same as the bat file directory
I've created a .bat file that I can use to drag and drop an mp4 video file onto it to convert reddit videos format to a format supported by whatsapp. All this using ffmpeg
Here's the code of the .bat ...
1
vote
0
answers
103
views
Windows .bat file asking to terminate y/n [closed]
Recently I've noticed something unusual when closing my batch application.
When I press x on console, it then outputs a line stating "C^Terminate batch job (Y/N): " which requires user input....
0
votes
1
answer
367
views
Variable set inside for loop not available outside
I'm basically trying to get just a drive's freespace (I don't have powershell).
For example, if my D: drive freespace is above 15 GB, I'll take any action. Interestingly, the script I wrote works ...
0
votes
1
answer
38
views
Fluke or Naming Error
Under the directory of my C:\Users\ME I have a directory called C:\Users\ME\Invoices. Its where I keep my bookkeeping and all that. However, I created a *.bat file, I called it Invoices.bat. I bet ...
1
vote
1
answer
147
views
Launching Chrome with url containing quesiton mark
I have been using this as reference to create a bat file to launch chrome with a predetermined url path but there is an issue I am having with this.
Here are the contents of my bat file
start "...
0
votes
2
answers
12k
views
How to specify directory path in .bat file?
I have a .bat file next to the (Result) folder.
The folder contains .jpg files with different names.
I'm trying to write a .bat file so that it renames all these files in this folder.
It works, but ...
0
votes
0
answers
1k
views
How to start batch file from the top left corner of the screen?
Is there any command to make a batch file start from the top left corner by default so that I can conviniently resize it using this command:
mode con: cols=50 lines=50
I want the batch window to ...
2
votes
2
answers
3k
views
read in multi line text file and assign multi-named environment variables in a batch file
I'm trying to read through a multi-line text file like...
C:\Test.txt
Text file contains:
bof --------------------------------
This is line 1
This is line 2
C:\util
This is line 4
EOF -------------...
2
votes
3
answers
222
views
Batch File How to not print final space in a vbscript
I have a question about something I've been trying to figure out for at least a good hour.
I have a batch file that creates a small VBS script so that I can do some complex calculations (well, at ...
1
vote
2
answers
774
views
Batch script to loop over subdirectories of a directory, then search within a subpath of each of those for a file pattern
I have a common issue in that I have multiple client setups on a server, and want to check in a particular folder in each of them for a filename, or file search pattern.
e.g. I might have this setup:
...
0
votes
2
answers
2k
views
Window Batch, code will work when pasted into command prompt, but not when run as a batch file
I am having an issue with a section of code designed to count the number of times a string appears in a text file. It will work perfectly when pasted into command prompt, but when run as a .bat file ...
3
votes
2
answers
1k
views
batch file put if inside for loop error
I have a working for loop to print all zip file's name under one working directory:
@echo off
setlocal
for %%i in (*.zip) do (
echo %%i
)
I have another working if block to check and print ...