Delete a folder - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4) +---- Forum: Scripting (/forumdisplay.php?fid=39) +----- Thread: Delete a folder (/showthread.php?tid=96381) Delete a folder by Lamaboy on 01-19-2011 at 05:30 AM
I've found this: code:but I need to do it for an entire folder, how can I do this? Thanks. RE: Delete a folder by Spunky on 01-19-2011 at 06:35 AM
I think the folder needs to be empty first anyway... code: Can't remember if Folder is a folder object or a string identifying it though... Just search for 'MSDN DeleteFolder' in Google RE: Delete a folder by gmr on 01-20-2011 at 12:14 AM
"File" must be a FileSystemObject. code: Further information: MSDN - DeleteFolder Method quote:No, see Remarks on the link above. RE: Delete a folder by Lamaboy on 01-20-2011 at 12:58 AM
Thanks, it works, but not quite. code:The folder is read only, so how else can I keep one specific window from recording chat logs? RE: Delete a folder by Spunky on 01-20-2011 at 06:23 AM
quote: I may have been thinking about PHP then. As for the permission thing, can you not change ownership of the folder or at least give yourself write permissions? RE: Delete a folder by CookieRevised on 01-20-2011 at 09:41 AM
quote:Can you explain in detail what you're trying to do? Can you show all the code you have? Because like it sounds now, you're trying to do something which you shouldn't be doing in the way you're doing it. (Constantly removing a folder to prevent a certain chat log from being created is a very very bad way of doing things. And if that is what you're trying to do then the reason for the error is that you can not remove something which is locked and used by another program for writing stuff to it. Thus instead of trying to remove the logs (which you will not be able to do properly anyways) you should disable the chat logging itself.) RE: RE: Delete a folder by gmr on 01-20-2011 at 05:55 PM
quote:I have no folder to test it under your circumstances right now if this works but have you tried to set the force parameter in the DeleteFolder Method described on the link I mentioned? If yes, maybe there is a WinAPI function to unlock the folder first? Well, I know there is one, but I'm not quite sure how you do it within JavaScript. And even if you can unlock it, you may run into other problems later. However, CookieRevised is right, deleting a folder that is used several times and locked for that shouldn't be deleted as it may lead to serious problems up to crashing the program (not WLM specific but who knows?^^). So, as CookieRevised said as well: more information may help us to help you. RE: Delete a folder by matty on 01-20-2011 at 05:59 PM
quote:In the Plus! menu on the conversation window you can disable chat logging can you not? If so just and it keeps enabling after you reopen the chat window write a script that clicks the menu item. RE: Delete a folder by Lamaboy on 01-20-2011 at 11:25 PM
I'll post my code, but you'll plainly see that I borrowed the entire first chunk of it from the usay script. code:Now I get "Error: XML document must have a top level element. (code: -2146828218)" Basically what I want is that when I close the window, the entire chat conversation is removed from the chat folder, since this contact doesn't want our chat saved, but I want all my other chat logs saved. If someone has a better way to do it, please let me know. Thanks. RE: Delete a folder by prashker on 01-21-2011 at 01:40 AM
Why delete it when you can just disable it from logging (FOR THAT CONTACT) RE: Delete a folder by Apatik on 01-21-2011 at 01:49 AM
Isn't there a filter option in the preferences where you can activate/deactivate logging by contact? RE: Delete a folder by prashker on 01-21-2011 at 01:57 AM
quote:Also true . Chat Logging -> Filter... RE: Delete a folder by Lamaboy on 01-21-2011 at 03:19 AM
Haha, I wish I knew that. Oh well, I have learned some with playing around with this, so I want to finish now. code:I don't understand how to set that to false, I don't know this language at all. I did come across that in the scripting help file though, just so you know I did try to do it myself. RE: Delete a folder by whiz on 01-21-2011 at 08:26 AM
quote:That's a property of the ChatWnd object, you can set it like this: jscript code: |