MS Virtual Foxpro 9 on Win 10; not recognizing CD commands

(I'm sorry if I've done this twice; I'm new here and it's a bit confusing)

Using Foxpro 9 on Win 10 (which I have done for several months) suddenly is largely impossible because FP doesn't seem to recognize CD (Change Directory) commands.  I have for years used commands like this (I have them stored in function keys)

CD d:\datafi~1\databa~1\synth99  

This should change the directory from whatever it is before to

d:\data files\databases\synth99

But it doesn't. Responds with an error message, "invalid path or filename."

Please advise.  Thank you.
Dan MoermanEmeritus ProfessorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

☠ MASQ ☠Commented:
I realise you're expecting it to but have you actually checked the path exists
Dan MoermanEmeritus ProfessorAuthor Commented:
Yes, the paths do exist. Thanks!!  dan
CD ("d:\data files\databases\synth99")
is the correct command because nobody can ensure the 8.3 path name is the one you've used for above path.

OTOH, I did not test 8.3 path names on W10 yet so wait a few hours please.
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Olaf DoschkeSoftware DeveloperCommented:
On Windows 10 using ADIR(laDirectories,"C:\*","D",2) and then look at the laDirectories array in the debugger in its Locals (local variables) window, I still see short DOS names with ~1, so in principle that works. For example there are C:\PROGRA~1 and C:\PROGRA~2, CD C:\PROGRA~1 or 2 also works.

But you can't be sure you always get the shortening with ~1, it could also be ~2, you're on a new system now and folders could have been created in a different order, So to know the short path don't guess it'll be ~1, get the short path via ADIR to know it.

Or much simpler: Use the long path.

Bye, Olaf.
Olaf DoschkeSoftware DeveloperCommented:
Additional info:

This suggests
a) 8.3 short names can be turned off
b) it's bad practice to make use of them, they may decrease directory enumeration performnce.

In old DOS days you had FAT file system and not NTFS, just because paths are shorter it doesn't make them faster, in NTFS file systems used throughout all Windows systems nowadays, also in home user systems, the short path rather is a side and extra info, which has to be looked up with extra effort. So get rid of the habit, indeed. Use long names. Your long path is not that much longer anyway. And spaces in path and file names are addressed via putting them in quotes. Just like in DOS. It should be no news to you.

Bye, Olaf.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Yes, 8.3 names can be disabled on your system... My VFP 9 on W10 can use them w/o problems.

If you are accustomed to using 8.3 names you may still use them... The time penalty is not so high.

You may display 8.3 paths and file names by DIR /X  command in (DOS) Cmd window, you may mix long and 8.3 names in one path but you have to be ready for ambiguous conversion between long and 8.3 names.

Even some recent software from Microsoft (MS Access Data engine) did not support long names in connection strings...
Olaf DoschkeSoftware DeveloperCommented:
MS Access connnection string did not support long names in connection strings, or do not?

In regard of performance it might be neglectable, but if that was a reason to use short names it's reverse today. In FAT the long names were the extra info in the TOC, nowadays it's the other way around.

In regard of the performance, one reasoning it won't matter much is, you even have further mechanisms slowing directory enumeration down today. In desktop.ini files you have references for regional/local names for system paths, for example the name of the Desktop folder is taken from the shell32 resource dll as LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21799.

That's just a side note.

I just created an Access 2013 database in a and an ODBC connection to it, and it works without any problem:

h2 = SQLStringConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=X:\a lengthy directory name\MyData.accdb;Uid=Admin;Pwd=;")

Open in new window

I don't see any pros for short file names in the same way as I see only pros for usage of verbose names. The real shortcut is putting the directory name on a function key. That's still just one key.

Bye, Olaf.

FYI, Dan,
the Environment Manager in the task pane allows you to do much more than just a directory change by choosing or configuring an environment you name as you like. You setup a default directory, the path and any SET setting, a resource file, can run an init script and a finalization script, have different field mappings to controls, form templates, and projects to be opened all under the roof of an environment name.
Try to connect DBF file please. It could have been Access 2010 Data engine.
Dan MoermanEmeritus ProfessorAuthor Commented:
Thanks to all for helping.  Much appreciated. It is sort of odd when a simple technique you have been using for 15 years or so just stops working from one day to the next.
We are also looking differently than 15 years ago :-)
Dan MoermanEmeritus ProfessorAuthor Commented:
Well, I sure do. 15 years ago I was a youngster at 60.
Wow new interesting EE feature is here!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.