Thanks for your response.

Let me give a bit more detail about that I'm trying to do. I have an app that allows the user to browse through directories and select files whose names are then passed to various other applications. Some of these apps can't handle filenames that contain unicode (non 7-bit ascii) characters). I want to modify my app so that if the user selects a file or directory containing unicode characters, my app can create the 8dot3 name on the fly. I can then run the filename through Win32::GetShortPathName to get a name consisting entirely of 7-bit ascii characters.

To address the points mentioned in your post:

1. 8dot3 names are already enabled on my system

2. understood

3.The perlmonks website converted the chinese characters to the notation that ended up in the post, apparently due to the fact that the filename was contained in a "<code>" section. Here's the real filename:

C:\Users\James\Music\國語懷念老歌 Vol. 2

So if I paste the following into a windows command shell

fsutil file setShortName "C:\Users\James\Music\國語懷念老歌 Vol. 2" "Vol~002"

the 8dot3 name is created as desired. Now I need to find a way to do this in my perl program.

4. not a problem in my case

5. I need to preserve the original file names, so renaming is not an option.


In reply to Re^2: Problem running shell command from Perl by CrashBlossom
in thread Problem running shell command from Perl by CrashBlossom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.