Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

putfile() not working?

Status
Not open for further replies.

Nigel Gomm

Programmer
Jan 10, 2001
423
CA
if putfile() and commondialog.showsave() start objecting that the filename doesn't exist

it's because the built-in anti-ransomware feature in windows control panel is switched on (for that folder).

(please don't ask how long it took me to connect the two).

hth

n
 
Nigel, could you explain this in a little more detail please. In particular, what is the anti-ransomeware feature? Excuse my ignorance, but I didn't know such a feature existed.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

go to windows control panel, virus and threat protection.... and near the bottom is Ransomware Protection.

Link


With that switched on PUTFILE() was giving this message when i selected a filename that didn't already exist.

Capture_bf8tlc.jpg


If i selected a filename that did exist it then didn't get overwritten by, for instance, STRTOFILE() - but there was no error message.

I only saw it do that in a compiled .exe. Worked fine from the VFP IDE command window which still confuses me.

In control panel you are able to select folders to protect and apps that can bypass this protection; first attempt at 'whitelisting' my .exe didn't work though.

I only tripped over this in the middle of doing something else and will have to find time to re-visit. But thought it worth posting asap.

n

p.s.
the common dialog .showsave() behaved as if both OFN_OVERWRITEPROMPT (0x00000002) and OFN_PATHMUSTEXIST (0x00000800) are set even though .flags = 0.
 
Thanks for the clarification, Nigel. It took me a while to find the ransomware protection (possibly because of some non-standard security settings). I'll investigate further.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top