Tolida Posted May 17, 2011 Posted May 17, 2011 HI, Ik 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:\Users\Tol\Desktop\File.csv and that works, when I put this in the textbox for the event I get errors and it does'nt work. How do I put this in the event textbox to get it working? can I use a Filemaker field or variable??
bcooney Posted May 17, 2011 Posted May 17, 2011 There's an old trick for deleting files. Simply export a zero found set using the path to the file, and it'll be deleted.
Tolida Posted May 17, 2011 Author Posted May 17, 2011 There's an old trick for deleting files. Simply export a zero found set using the path to the file, and it'll be deleted. Do you also know how to do it via "send event" It must be possible with the command in my example command, I think my problem is that maybe I have to put some quote's, but I don't know where to put them. FileMakerHelp is no help..
Wim Decorte Posted May 27, 2011 Posted May 27, 2011 it's absolutely possible and you're very close. You need quotes around the path and the file name. So it would look like this: cmd /c del "C:\Users\Tol\Desktop\File.csv" also note the space between 'cmd' and '/c'
Tusif Ahmad Posted November 17, 2011 Posted November 17, 2011 Is there a way.. we filter 30 days old files from a specific folder and delete.
brian rich Posted November 17, 2011 Posted November 17, 2011 You could use a plug-in. Have a look at the BaseElements plugin which you can find here. http://www.goya.com....elements/plugin It is open source and free. The function BE_ListFilesInFolder ( path {; type } ) will get you all the files in the folder you specify in <path> into a return separated list. BE_DeleteFile ( path ) will allow you to delete the file at <path>. If you need the file creation dates so you can determine which files are more than 30 days old, you could use the function BE_ExecuteShellCommand ( command {; waitForResponse } ) and execute the command line DIR function for the folder. This returns the standard command line response to the DIR command which might look somethinglike this. Volume in drive C is OS Volume Serial Number is 5809-E1FA Directory of C:Usersbrian.rich360Works 15/11/2011 15:26 <DIR> . 15/11/2011 15:26 <DIR> .. 15/11/2011 17:02 12,467 360Plugins_FMAdvanced.log 15/11/2011 15:26 0 360Plugins_FMAdvanced.log.lck 10/10/2011 07:43 28,826 360Plugins_Runtime.log 10/10/2011 07:42 0 360Plugins_Runtime.log.lck 07/11/2011 13:44 157,909 360Plugins_WPE.log 07/11/2011 13:43 0 360Plugins_WPE.log.lck 16/11/2011 09:28 362,505 miscellaneous.log 7 File(s) 561,707 bytes 2 Dir(s) 107,413,880,832 bytes free (This should line up in columns but the post view doesn't show this properly - sorry) The creation date is in the first column and the file name is at the end. You'll need to process the response to get out the information you want, but this should be a straightforward parsing exercise. HTH Brian
Kris M Posted November 17, 2011 Posted November 17, 2011 360 works scriptmaster (free) is a plug in that also provided this functionality.
Wim Decorte Posted December 15, 2011 Posted December 15, 2011 plugins can do this easily. You can also do it without a plugin by using a VBscript stored in a container field (or generated as text based on your parameters) and exported out (Export Field Contents script step) and then fired by a Send Event script step. VBscripts pack more power than command lines or batch files and are more intuitive to write than complex batch files.
Matt Malyschko Posted November 17, 2013 Posted November 17, 2013 it's absolutely possible and you're very close. You need quotes around the path and the file name. So it would look like this: cmd /c del "C:UsersTolDesktopFile.csv" also note the space between 'cmd' and '/c' this worked perfect for me - i am wondering if it's possible to do something similar with FM Go as well.
Recommended Posts
This topic is 4022 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 accountSign in
Already have an account? Sign in here.
Sign In Now