Skip to main content

All Questions

Tagged with
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" "...
rage0920's user avatar
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 ...
gkln's user avatar
  • 363
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 ...
ankitd's user avatar
  • 205
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 ...
Francisco Laferrière's user avatar
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....
user1250662's user avatar
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 ...
Santhosh Ram's user avatar
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 ...
EnlightenedFunky's user avatar
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 "...
Sweepster's user avatar
  • 113
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 ...
Артем's user avatar
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 ...
batchcoding____s's user avatar
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 -------------...
WithaKay's user avatar
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 ...
Flaver-D's user avatar
  • 165
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: ...
monty's user avatar
  • 146
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 ...
lucasr48's user avatar
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 ...
peterboston's user avatar

15 30 50 per page
1
4 5
6
7 8
25