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 Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
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
Outlook 2007 "The system cannot find the file specified"
URLs embedded in received messages in Outlook 2007 give the error "The system cannot find the file specified". If I cut and paste the URL into a browser, it works fine. The URL is apparently not being passed to the default browser (IceDragon). I tried making Opera the default browser, but that...
Microsoft Office
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
System Image: "System cannot find the file specified (0x80070002)"
I have a Dell 2330 all-in-one running Win7 64 bit. I'm trying to do a system image back up to a USB3 external hard drive. The image will take up about 333gb and I have about twice that amount of space left on the 1 TB drive. I get the error message: System cannot find the file specified...
Backup and Restore
"The system cannot find the file specified" Driver install
I recently purchased a wireless adapter for xbox 360. its not a genuine microsoft product. i have tried everything to install the driver but everytime it says "Windows found driver software for your device but encountered an error while trying to install it xbox360 wireless reciever for windows...
Drivers


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 16:37.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App