Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Batch renaming files fails, error "the system cannot find file..."

03 Aug 2016   #1
MikeAm3

Windows 7 Home Premium 64bit.
 
 
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 System SpecsSystem Spec
.
03 Aug 2016   #2
samuria

win 8 32 bit
 
 

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 System SpecsSystem Spec
03 Aug 2016   #3
MikeAm3

Windows 7 Home Premium 64bit.
 
 

Renaming bulkrename.bat to bulkrename.cmd and running it made no difference. Same error message. But anyway thanks for the idea.
My System SpecsSystem Spec
.

04 Aug 2016   #4
MikeAm3

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 System SpecsSystem Spec
Reply

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




Thread Tools




Similar help and support threads
Thread Forum
bluetooth services can't be changed "the system can not find the file"
when i try to enable or disable any of the bluetooth services for my bluetooth headset on my pc it just gives an error.. BUT it doesnt tell me WHAT file is not found.. How do I find out what file is missing so i can fix the error??? it just tells a generic message box "file can not be found"...
Sound & Audio
SFC fails to repair corrupt member files "mstsc.mof" and "mstscax.mof"
Hello, I've scanned my laptop with SFC four times in this past week, and each scan ended with the same failure to repair specific files. I'm uncertain how to proceed with these corrupted files. I followed the instructions in the SFC /SCANNOW tutorial; I installed the System Update Readiness...
Performance & Maintenance
General sysntax guidelines for a batch file-- "my system"
I have a precoded batch file to run in command mode. It gives commands to regedit but without my specific machine info the batch fail fails. In the sample : reg load HKLM\MY_SYSTEM and refers to this on three lines MY_SYSTEM has to refer to the Win7 being used? I tried the...
General Discussion
Windows cant "find" any .EXE files or any file that requires admin
This has been happening for 7 months now, and i've had enough. spent over 70$ on games, which cant run because windows can't find firewall settings. Or it just cant find the file in the first place. Windows can run certain .exe files that were before this started happening, but any installer or...
Software
Shortcuts to EXE files "Open File location" fails
When opening Properties of a shortcut ...Properties (dlg) > Shortcut (tab) > "Open File location" ... in the Navigation pane "Favorites" is ALWAYS hi-lited with the non-favorite EXE file in the results pane :confused: No amount of refreshing or coaxing will show the actual "containing...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 15:37.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App