Jump to content

FM11: How to delete a file in a windows network folder.


This topic is 4037 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I want to delete a file from FileMaker in Windows.
I want to send a event from FileMaker to do that.

From the commandprompt I type:

cmd/c del C:UsersTolDesktopinvoice.pdf

 

and that works,

 

but when tried to delete the file in a network drive (P:invoiceinvoices::id.pdf), i put the code

 

"cmd /c del " & Quote ( "P:Invoice "&Invoices::Invoice ID&".pdf") 

 

in the calculation box for the event I get errors and it doesn't work, i can't figure out what am i doing wrong. Any help would be appreciated. Thanks

 

 

post-108466-0-06011200-1362837172_thumb.

Link to comment
Share on other sites

The backslash in FileMaker is used to "escape" the next character; that is, inform Filemaker that the next character is a literal character and not a command character.

 

So you have to use another backslash to tell FM that the backslash in the file path is literally a backslash in the string:

 

"cmd /c del P:Invoice "&Invoices::Invoice ID&".pdf" 

 

 

see http://help.filemaker.com/cgi-bin/filemaker.cfg/php/xml_api/cci/fm_show_ans.php?p_faqid=456&p_sid=459394139 for perhaps a clearer explanation.

 
 
PS-- You don't want to use the Quote() function because it places quotation marks around the expression.
Link to comment
Share on other sites

Hi Doughemi,

 

Thank you very much!!! It's been so long trying to figure this one out. Who would have thought about this "escape" thing. You have a lovely weekend. Hope my thread and your answer will help future users.

Link to comment
Share on other sites

This topic is 4037 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.