Solved

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

Posted on 2016-07-25
12
48 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 62

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 42

Assisted Solution

by:pcelba
pcelba earned 250 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 250 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 29

Accepted Solution

by:
Olaf Doschke earned 250 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 42

Assisted Solution

by:pcelba
pcelba earned 250 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 29

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 42

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 42

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 42

Expert Comment

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

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dual boot help 2 34
How to add a web site image to my desktop 15 45
WSUS Updates 5 19
WSUS Kb4012212 and Kb4012215 not applicable 14 39
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
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…
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…

751 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