×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Windows 10 and Server 2016 running VFP compiled exe

Windows 10 and Server 2016 running VFP compiled exe

Windows 10 and Server 2016 running VFP compiled exe

(OP)
I am posting this as general information in case someone has trouble in the future.
I have a client with a server running my (VFP compiled executable) and numerous PC's running on a network using mapped drives. The client updated to Windows Server 2016 and the trouble started. The errors were to do with "Can't find xxx on Users/John etc" (the original computer I work on). In short it appeared the network was dropping out.
The technician blamed my app of course so I showed him it worked fine when running through a VPN and Remote Desktop.
It wasn't until I Googled and found that Windows 10 (or Server 2016) drops Mapped Drives when they are idle for a time. The answer was to use a UNC path in the shortcut instead of an address via the mapped drive.
It is fine now running the UNC path. Never a dull moment
Cheers
John

RE: Windows 10 and Server 2016 running VFP compiled exe

That's not a new problem. The server admin can also do

CODE

net config server /autodisconnect:-1 

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: Windows 10 and Server 2016 running VFP compiled exe

(OP)
Ha ha you are on the ball Olaf, I will add that to my box of tricks thanks.
There is another one that has foxed me for years. When Optimistic buffering is enabled it often corrupts my cdx files and worse. Forever I have tried to find a way to detect whether Write Caching is enabled on a PC so I can correct it. You got any ideas on that ?

Thanks and regards
John

RE: Windows 10 and Server 2016 running VFP compiled exe

Are you confusing optimistic buffering with optimistic locking?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Windows 10 and Server 2016 running VFP compiled exe

(OP)
Thank you but while this article deals with how to disable oplocks I couldn't find anywhere that describes how to programmatically detect their status if enabled.
Cheers
John

RE: Windows 10 and Server 2016 running VFP compiled exe

(OP)
Hi Mike
No confusion, buffering is the problem (write caching etc being the most common)

Cheers
John

RE: Windows 10 and Server 2016 running VFP compiled exe

Sorry just wanted to share what we did do deal with corrupting indexes etc.
Thought this might help here too.

Wibenji

RE: Windows 10 and Server 2016 running VFP compiled exe

(OP)
Winendji - Disable write caching on the C: drive

Cheers
John

RE: Windows 10 and Server 2016 running VFP compiled exe

Nowadays oplocks can't be disabled. It's a really high risc to run an old enough Server where SMB can be configured about that, as RANSOMWARE exploits vulnerabilities in older SMB versions. So forget about learning whether that's turned on or off. You should assume it's always on and set these keys on each client within setup of your application:

CODE

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
"FileInfoCacheLifetime"=dword:00000000
"FileNotFoundCacheLifetime"=dword:00000000
"DirectoryCacheLifetime"=dword:00000000 

Bye, Olaf.



Olaf Doschke Software Engineering
https://www.doschke.name

RE: Windows 10 and Server 2016 running VFP compiled exe

(OP)
Hi Olaf, thank you very much. You have an amazing knowledge of this stuff. I wish some of my client's engineers had anywhere near as much. Can I ask a couple of questions please:
Should I use these registry entries on the Server only or on the workstations as well ? Bearing in mind all the data resides on the server, but temporary workspace is on each workstation so buffering happens when saving data to the server (or lost in a workstation outage).
I will probably have to check if the entries exist on each start up of the app because workstations get replaced.
Next I will have to learn how to check the registry and insert these values into it.
Thanks agai
John

RE: Windows 10 and Server 2016 running VFP compiled exe

This isn't even affecting servers. It's a client registry setting, as I said:

Quote (myself)

set these keys on each client within setup of your application

It could suffice to set these keys in normal elevation within the application, generally, keys in HKEY_LOCAL_MACHINE\Software get virtualized and redirected to HKEY_CLASSES_ROOT\VirtualStore\Machine\Software
(see https://www.thewindowsclub.com/file-registry-virtu...)

If you try you'll see when looking into the registry at the desired location, when starting regedit elevated.

I still wish it would be an application setting, though it's not a per process but a per file thing. In most cases only one application uses a set of its own files like database files. So when it's known oplocks harm the files, there is no benefit insisting on them.

That it's a per-client setting makes it harder, but if not all clients use your software some still profit from oplocks, they're not overall having such bad effects as they have on DBFs and especially CDX and other database files. I know what you're talking about, that was the strongest effect I had once. We didn't solve it this way, way back then the only solution was to stay with Server 2003 for some databases, I don't even know if these settings applied with windows Vista, as I didn't know them back at the time, only you couldn't turn off oplocks and so the straight forward solution was using some file server not knowing them. That customer was weird, they used XP, Vista, Windows 8. They skipped the best Window Versions 7 and don't know whether they moved to 10 by now (which I think of as strong progress) or still use 8.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: Windows 10 and Server 2016 running VFP compiled exe

(OP)
Thanks Olaf, this is all a bit (a lot) above my head but I will try to learn how to get and set registry items. Then maybe do some practice runs.
Regards, John

RE: Windows 10 and Server 2016 running VFP compiled exe

If you run regedit, you'll automatically be asked to elevate, so keys get to where they need to be.
If you have a setup and use ISE's way of defining registry keys the same applies.

There is code in the FFC samples about registry keys. So it's easy enough to set keys. The ffc class doesn't cover all type of keys, especially not dword keys, but search this site and you'll find a way to do that: thread184-869241: How to create 'DWORD Value' in registry?

Anyway, it should best be a step the setup makes and not your application.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close