Solved Batch renaming files fails, error "the system cannot find file..."

MikeAm3

New member
Local time
8:45 AM
Messages
3
Batch renaming files fails, error "the system cannot find file..."

Hi all,

I'm trying to rename files with batch file "bulkrename.bat", that is generated by a short program made with Visual Foxpro 9.0.

Here is the source code of Foxpro program:
TV recordings renamed with XML metadata tag
And here is generated "bulkrename.bat":

------------------- snip ----------------------
RENAME "D:\Data\TV_Database\Test_data\Silmänräpäyksiä @ SE social_political issues_economics (general) - 2016-08-01-20_57 -Yle Fem.ts" "Silmänräpäyksiä @ (Sarjan lyhyet tietoiskumaiset elokuvat t...elevat maailman ilmiöitä lähikuvassa.) SE social_political issues_economics (general) - 2016-08-01-20_57 -Yle Fem.ts"

RENAME "D:\Data\TV_Database\Test_data\Silmänräpäyksiä @ SE social_political issues_economics (general) - 2016-08-01-20_57 -Yle Fem.xml" "Silmänräpäyksiä @ (Sarjan lyhyet tietoiskumaiset elokuvat t...elevat maailman ilmiöitä lähikuvassa.) SE social_political issues_economics (general) - 2016-08-01-20_57 -Yle Fem.xml"
------------------- snip ----------------------

The batch file fails with error messages
"the system cannot find file specified"

However if I copy-paste individual command lines into Win7 Command Prompt windows, file renaming works just fine. What is the difference with batch window and Command Prompt window?

I tried to run batch file with Administrator rights with no luck.
Path + filename are max. 200 characters.
I also tried to manually remove characters like ( ) but that didn't help.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium 64bit.
Welcome to the forum can you rename the file to .cmd instead of .bat there are differences see if it work then as it works with a cmd prompt. a .bat was for the old msdos 16 bit .cmd is for windows cmd
 

My Computer

Computer type
PC/Desktop
OS
win 8 32 bit
Renaming bulkrename.bat to bulkrename.cmd and running it made no difference. Same error message. But anyway thanks for the idea.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium 64bit.
I did some detective work.

I shortened the command line like this:
RENAME "D:\Data\TV_Database\Test_data\Sil.ts" "Silmänräpäyksiä @ (Sarjan lyhyet tietoiskumaiset elokuvat t...elevat maailman ilmiöitä lähikuvassa.) SE social_political issues_economics (general) - 2016-08-01-20_57 -Yle Fem.ts"

And here is the result after renaming:
Silmõnrõpõyksiõ @ (Sarjan lyhyet tietoiskumaiset elokuvat t...elevat maailman ilmi÷itõ lõhikuvassa.) SE social_political issues_economics (general) - 2016-08-01-20_57 -Yle Fem.ts

WRONG CHARACTERS!

So I need to change the character set in the command window.
I added this line in the beginning of my batch file:
chcp 1252

Here is the result:
Silmänräpäyksiä @ (Sarjan lyhyet tietoiskumaiset elokuvat t...elevat maailman ilmiöitä lähikuvassa.) SE social_political issues_economics (general) - 2016-08-02-18_56 -Yle Fem.ts

CORRECT!
Problem solved.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Home Premium 64bit.
Back
Top