Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#349791 - 12/01/2012 17:49 C:\Program
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
Came across an odd one with Windows today (ugh, already hitting "fun" issues again with this OS), and I can't find a good reason why this is an issue.

An unquoted path caused a script to create a file called Program in the C:\ drive. When this occurred, and Windows 7 rebooted, it warned about this and recommended renaming the file. When I didn't, I noticed a 3rd party service wasn't running. Attempting to start it lead to Error 193:0xc1 (Not a valid Win32 application).

My first though is that it's due to the legacy 8.3 filenames, and C:\Program clashing with Program Files (Progra~1 normally in 8.3 format). But that doesn't fully make sense to me, since program is just 7 characters, and shouldn't have resulted in a ~1,~2 situation.

Any ideas why C:\Program can tank some programs?

Top
#349792 - 12/01/2012 19:41 Re: C:\Program [Re: drakino]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
"dir /x" will show you the 8.3 names. Maybe that will provide some information?
_________________________
Bitt Faulk

Top
#349793 - 12/01/2012 19:42 Re: C:\Program [Re: drakino]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Also:

C:\Program Run
Run, Program, Run
_________________________
Bitt Faulk

Top
#349794 - 12/01/2012 20:51 Re: C:\Program [Re: wfaulk]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
dir /x confirms that it is just C:\Program with no special second 8.3 name. Only ones on the C:\ that did have special 8.3 names are PROGRA~1 Program Files and PROGRA~2 Program Files (x86)

Top
#349795 - 12/01/2012 21:37 Re: C:\Program [Re: drakino]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Originally Posted By: drakino
Any ideas why C:\Program can tank some programs?


Question: Was it only the third party service that failed? i.e., not Windows itself?
_________________________
Tony Fabris

Top
#349796 - 12/01/2012 21:59 Re: C:\Program [Re: drakino]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4180
Loc: Cambridge, England
Originally Posted By: drakino
it warned about this and recommended renaming the file

That's very suspicious. What exactly did the warning say? Perhaps there's some special and terrible hack in there somewhere that says, if you try and execute a command called "C:\Program", and that file doesn't exist, and the command's first argument starts with "Files\", then magically treat the command and first argument as if they were a single command with a space in the middle. That would be foul and nasty, but it would provide a modicum of compatibility with buggy legacy programs, and Microsoft have a history of resolving that sort of dilemma in favour of foulness and nastiness.

Peter

Top
#349797 - 12/01/2012 22:27 Re: C:\Program [Re: peter]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
Windows booted fine, and I think all my normal services started fine. It was just one 3rd party service that had a fit. Searching for the full error in Google turns up people hitting this on older Windows versions, with Windows specific services also being impacted by whatever weirdness is going on. I guess Microsoft fixed all of their instances where it could break things, but not every 3rd party. Seeing references to a lot of different apps breaking due to this.

Here is the exact dialog that pops up.
Originally Posted By: File Name Warning
There is a file or folder on your computer called "C:\Program" which could cause certain applications to not function correctly. Renaming it to "C:\Program1" would solve this problem. Would you like to rename it now?

It also has a checkbox with an option "Don't perform this check at startup" along with buttons to rename the file or ignore it.

I think Peter's explanation is probably true. Some old API likely allowed paths with spaces, and didn't quote the path. Makes me wonder if there was something similar for the older "Documents and Settings" folder.

I should probably stop wondering why MS stuff works like it does, before I suffer some sort of elder god style madness.

Top
#349806 - 13/01/2012 15:15 Re: C:\Program [Re: drakino]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Haha. I love it.

If corporations are people (my friend), then Microsoft is an Old One.
_________________________
Bitt Faulk

Top
#349807 - 13/01/2012 15:27 Re: C:\Program [Re: peter]
Roger
carpal tunnel

Registered: 18/01/2000
Posts: 5683
Loc: London, UK
Originally Posted By: peter
Perhaps there's some special and terrible hack in there somewhere that says, if you try and execute a command called "C:\Program", and that file doesn't exist, and the command's first argument starts with "Files\"


Not quite. Watch it with Process Monitor.

Given "C:\Program Files\Foo\Bar.exe", it tries:

"C:\Program" "Files\Foo\Bar.exe"

That fails, so it tries the next one, which works. There's nothing special about "Files\", or "C:\Program", for that matter.

I'm not sure what it does for "C:\Program Files\Foo\Bar.exe baz quux"...
_________________________
-- roger

Top