Solved

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

Posted on 2016-07-25
12
36 Views
Last Modified: 2016-08-22
(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.
0
Comment
Question by:Dan Moerman
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 62

Expert Comment

by:☠ MASQ ☠
Comment Utility
I realise you're expecting it to but have you actually checked the path exists
0
 

Author Comment

by:Dan Moerman
Comment Utility
Yes, the paths do exist. Thanks!!  dan
0
 
LVL 41

Assisted Solution

by:pcelba
pcelba earned 250 total points (awarded by participants)
Comment Utility
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.
0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 250 total points (awarded by participants)
Comment Utility
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.
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 250 total points (awarded by participants)
Comment Utility
Additional info:

https://support.microsoft.com/en-us/kb/121007

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.
0
 
LVL 41

Assisted Solution

by:pcelba
pcelba earned 250 total points (awarded by participants)
Comment Utility
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...
0
Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

 
LVL 29

Expert Comment

by:Olaf Doschke
Comment Utility
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=;")
=SQLTables(h2,"TABLE","crsTables")
BROWSE

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.
1
 
LVL 41

Expert Comment

by:pcelba
Comment Utility
Try to connect DBF file please. It could have been Access 2010 Data engine.
0
 

Author Comment

by:Dan Moerman
Comment Utility
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.
0
 
LVL 41

Expert Comment

by:pcelba
Comment Utility
We are also looking differently than 15 years ago :-)
0
 

Author Comment

by:Dan Moerman
Comment Utility
Well, I sure do. 15 years ago I was a youngster at 60.
0
 
LVL 41

Expert Comment

by:pcelba
Comment Utility
Wow new interesting EE feature is here!
0

Featured Post

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Join & Write a Comment

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now