Fixing 'Missing Operator' Error in Batch Script for Renaming JPG Files on Windows
I'm trying to rename image files (JPGs) on a Windows machine. I want to add an incrementing number (e.g., file1.jpg, file2.jpg, etc.) to each filename.
I wrote a batch script using a loop, but I'm encountering a 'Missing operator' error. Here's the relevant part of the script:
Can anyone help identify the issue causing the error? @Middleware & OS
6 Replies
In batch scripting use double exclamation marks as in
!!
to expand your variables within arithmetic operations.
Lemme give you a fix:
It's just syntax error
@SterlingOkay, okay... Thanks very much @Dtynin
@Sterling The issue causing the
Missing operator
error is that when you're running the bash script in a command prompt window, you need to use double percent signs %%
for the loop variable %i
.Alright, I will take note of that. Thanks @Enthernet Code
Yh something like this
Select all the file you name in explorer put the header you want, it will be incremented auto