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


  1. Posts : 3
    Windows 7 Home Premium 64bit.
       #1

    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


  2. Posts : 3,788
    win 8 32 bit
       #2

    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


  3. Posts : 3
    Windows 7 Home Premium 64bit.
    Thread Starter
       #3

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


  4. Posts : 3
    Windows 7 Home Premium 64bit.
    Thread Starter
       #4

    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


 

  Related Discussions
Our Sites
Site Links
About 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 07:12.
Find Us