Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2016-07-25
12
Medium Priority
?
63 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 63

Expert Comment

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

Author Comment

by:Dan Moerman
ID: 41728588
Yes, the paths do exist. Thanks!!  dan
0
 
LVL 43

Assisted Solution

by:pcelba
pcelba earned 1000 total points (awarded by participants)
ID: 41728742
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 30

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 1000 total points (awarded by participants)
ID: 41728956
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 30

Accepted Solution

by:
Olaf Doschke earned 1000 total points (awarded by participants)
ID: 41729329
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 43

Assisted Solution

by:pcelba
pcelba earned 1000 total points (awarded by participants)
ID: 41729343
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
 
LVL 30

Expert Comment

by:Olaf Doschke
ID: 41729425
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 43

Expert Comment

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

Author Comment

by:Dan Moerman
ID: 41735006
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 43

Expert Comment

by:pcelba
ID: 41735024
We are also looking differently than 15 years ago :-)
0
 

Author Comment

by:Dan Moerman
ID: 41735080
Well, I sure do. 15 years ago I was a youngster at 60.
0
 
LVL 43

Expert Comment

by:pcelba
ID: 41760706
Wow new interesting EE feature is here!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

926 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