TheBigEye Posted November 28, 2006 Posted November 28, 2006 (edited) Hi all, Is there any way to delete a file via scripting?? I´m using a file for storing temporary during an importation and i don´t need the file after the import is done. Thanks Edited November 28, 2006 by Guest
Genx Posted November 28, 2006 Posted November 28, 2006 Hi BigEye , Welcome to the forums!! Yes, there is a way you can do it by using windows cmd scripting -- not really the real term for it but meh. The syntax you have to use is: del "C:YourFilePathYourFile.YourExtension" In FileMaker --> Enter Script Maker --> Choose Send Event --> insert the calculation: "del "C:YourFilePathYourFile.YourExtension"" To delete YourFile.YourExtension (Assuming that C: Is your drive). Note that you can also use variables filenames aswell (they don't have to be hardcoded)
TheBigEye Posted November 29, 2006 Author Posted November 29, 2006 Thanks Genx it worked very nice but i have to change it to "cmd /c del "MyPathMyFile.Ext""
Genx Posted November 29, 2006 Posted November 29, 2006 if you make it "cmd /c/k del "MyPathMyFile.Ext"" should work even better
LaRetta Posted November 29, 2006 Posted November 29, 2006 ...windows cmd scripting -- not really the real term for it but meh. Nope not the term. The DOS batch language probably came out before you were born. But show it some reverence; it's still alive under the hood and it isn't windows either. Joking aside, I still occasionally use DOS batches (old habits die hard). ;)
Genx Posted November 29, 2006 Posted November 29, 2006 Sure, wont argue with you there... No going to say i'm sorry i missed it when it was running as the general interface.
Genx Posted November 29, 2006 Posted November 29, 2006 But... as far as i know, the CMD console is NOT actually DOS.. Nothing has direct access to DOS if you're in an operating system. The CMD console may interprate DOS commands and pass them on to dos if it deems necessary, but it will filter them to make sure you don't do silly things like format your hard drive Jokes aside though, VBS is quicker and can do a lot more.
LaRetta Posted November 29, 2006 Posted November 29, 2006 VBS is quicker and can do a lot more. Agree totally, Genx. I'm just getting into VBScript (only mid-level stuff so far). But, thanks to Wim, I've gotten a good base. :wink2:
Recommended Posts
This topic is 6571 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