• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 83
  • Last Modified:

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.
0
Dan Moerman
Asked:
Dan Moerman
  • 5
  • 3
  • 3
  • +1
4 Solutions
 
☠ MASQ ☠Commented:
I realise you're expecting it to but have you actually checked the path exists
0
 
Dan MoermanEmeritus ProfessorAuthor Commented:
Yes, the paths do exist. Thanks!!  dan
0
 
pcelbaCommented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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.
0
 
Olaf DoschkeSoftware DeveloperCommented:
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
 
pcelbaCommented:
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
 
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=;")
=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
 
pcelbaCommented:
Try to connect DBF file please. It could have been Access 2010 Data engine.
0
 
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.
0
 
pcelbaCommented:
We are also looking differently than 15 years ago :-)
0
 
Dan MoermanEmeritus ProfessorAuthor Commented:
Well, I sure do. 15 years ago I was a youngster at 60.
0
 
pcelbaCommented:
Wow new interesting EE feature is here!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 5
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now