PLAYSOUND requires 8-dot-3 name?

May 20, 2008
10,634
82
Syracuse, NY, USA
What's up with this (on Win7 and Win10)?
Code:
c:\windows\winsxs\x86_microsoft-windows-shell-soundthemes-raga_31bf3856ad364e35_6.1.7600.16385_none_d3c4653bd6165c87> playsound "Windows Ding.wav"
The filename is invalid.  Make sure the filename is not longer than 8 characters, followed by a period and an extension.
"Windows Ding.wav"
 
May 20, 2008
10,634
82
Syracuse, NY, USA
It's not the file name. If "Windows Ding.wav" is in a directory with a short(er?) path, it works OK. The test in my first post was on Win7. On Win10 (where it failed similarly), I CDD'd to the UNC path of the Win7 file.
 
May 20, 2008
10,634
82
Syracuse, NY, USA
I moved the file to a place where I have full control and did a little experimenting.

The error occurs when the number of characters in the file's TRUENAME surpasses 132.

That's just about half of MAX_PATH. I figure someone left out " * sizeof(WCHAR) " somewhere ... quite possibly someone at Microsoft. ... but it seems a peculiar error for a buffer being too small.

There is no error in the first case below. The same thing happens when the file is named "WindowsxDing.wav".

Code:
v:\> do i=107 to 108 ( md %@repeat[x,%i] & copy /q "Windows Ding.wav" %@repeat[x,%i]\
& echo length = %@len[%@truename[%@repeat[x,%i]\Windows Ding.wax]] & playsound "%@repeat[x,%i]\Windows Ding.wav"
& rd /s /q /ne %@repeat[x,%i]\ )

length = 132
length = 133
The filename is invalid.  Make sure the filename is not longer than 8 characters, followed by a period and an extension.
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\Windows Ding.wav"
 
Thread starter Similar threads Forum Replies Date
B Support 1
B Support 2
E Support 2