I have a couple of folders each containing up to 100 pdf files more or less. For each folder I want to batch rename the files so that they will start with the Hebrew letter "ת" and then will have a sequential number. However, I don't want to start the numbering from 1. For example:
pdfa will be ת20
pdfb will be ת21
pdfc will be ת22
and so on...
I tried looking at previous questions and coping the codes that were suggested there with the appropriate changes (like this one and this one but when running the codes on powershell it kept saying that either something in the command is missing or that something in the command is invalid (if needed, I can supply screenshots).
Codes I've tried:
@echo off
setlocal ENABLEDELAYEDEXPANSION
set/a fileNum = 1
for %%f in (*.mp4) do (
ren %%~nf%%~xf !fileNum!%%~xf
set/a fileNum += 1
)
The powershell has said that @echo off is an Unexpected token
, so I tried removing that line. It then said The term 'setlocal' is not recognized as the name of a cmdlet, function, script file, or operatble program
.
After that notice it continued with set/a
and said the same thing, and finally it showed the rest of the code and said it is missing and opening and closing.
I then tried running ls -v | cat -n | while read n f; do mv -n "$f" "$n.pdf"; done
. I got the error Missing statement body in do loop
.
It is important to notice that I have permission to reach these files only via my work computer which means that I'm not the admin and I cannot download new software.
Is there a way to do so?
Thanks in advance.