Bad Filenames

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15378
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Bad Filenames

Post by ChrisGreaves »

Is this the correct forum? It is not so much a question of VBA as in Windows criticism of file names

BadFileName.png
RunTime Error RTE 52 Bad FileName
This puzzles me. I suspect that the problem is the question-mark symbols in the file name.

I have loaded a string array of filenames from my hard drive and am now processing those names.
The file in question is an HTML file; Geoff sent me an email and I saved the email to disc, as I do every day.

Windows7 saved the file to my hard drive in 20th January this year.
Windows7 used the strings of characters from FireFox browser (File, saveAs) to create the file.
Win7 didn’t object to the question-marks then.
Why should it care now?

I can fix the file name – that’s not a problem.

I can’t understand how Win7 lets this slip through at the time of Saving, only to opbject months later at the time of use.

I imagine too that Win7 has been seeing the filename in all sorts of situations over the past six months – backing up, defragmenting, building an Index and so on.

Thanks
Chris
You do not have the required permissions to view the files attached to this post.
Last edited by ChrisGreaves on 24 Jul 2018, 15:08, edited 1 time in total.
You can't develop a solution to a problem until you have defined the problem

User avatar
HansV
Administrator
Posts: 78060
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Bad Filenames (correct forum?)

Post by HansV »

It's weird that Windows allowed saving the file with a ? in the filename in the first place - if you try to do so manually, you get a popup:
S2272.png
Apparently it slipped through, but as you have found, it causes problems.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15378
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Bad Filenames (correct forum?)

Post by ChrisGreaves »

HansV wrote:Apparently it slipped through, but as you have found, it causes problems.
Thanks Hans, for the confirmation.
This is not a big problem for me locally.
I wonder (heh heh!) if anyone who is running the Latest Windows cares to try it:-
Send yourself and emaIL with question marks (or other illegal characters) in the Subject field, then save that Email from a browser in full web format.

Just curious right now.
Chris
You can't develop a solution to a problem until you have defined the problem

User avatar
HansV
Administrator
Posts: 78060
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Bad Filenames (correct forum?)

Post by HansV »

When I do so from IE11 on Windows 10, the question mark is automatically omitted from the file name. If I add the ? manually, the file doesn't save.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15378
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Bad Filenames (correct forum?)

Post by ChrisGreaves »

HansV wrote:When I do so from IE11 on Windows 10, the question mark is automatically omitted from the file name. If I add the ? manually, the file doesn't save.
OK. Thanks Hans.
My guess then is that this was some sort of flaw in Win7 that has been fixed now.
Cheers
Chris
You can't develop a solution to a problem until you have defined the problem

User avatar
John Gray
PlatinumLounger
Posts: 5386
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Bad Filenames

Post by John Gray »

Perhaps Windows is taking a moral stance on the matter, and rejects your luke-warm Happy Christmas message?
John Gray

Venison is quiet deer, and quite dear.