Deleting a Folder Immediately

Hi
I'm new to Applescript and have not been able to find an answer after doing a search on the web or in this forum; is there a command that deletes a folder or file immediately rather than just moving it to the trash?

using the unix command rm is much faster than deleting files with finder commands in applescript. (this is true of shell scripting in general)
before starting, you should learn more about the command by opening a new window in the Terminal app and typing:
man rm
this will tell you all the details about how it works.
Also, when using unix commands, remember to use "quoted form of posix path of (file alias)". Finder paths (colon separated) will not compute.

Similar Messages

  • Remove caches file's automatically if you delete a folder from your drive???

    Gday,
    First off all sorry for my poor/bad English.
    When i remove/delete a folder in bridge, where will by the cache file of this folder??
    Does it also Remove/delete automatically, ????
    Or should I in the preferences box, tick on the (automatically Export Cache to folders when possible) option???
    Already many Thanks,
    Henry

    As the others say, no, the backup copy won't be deleted immediately, but it will eventually.
    If you want to delete all backups of a selected item, such as for space or security reasons, see #12 in Time Machine - Frequently Asked Questions.

  • I want to delete a folder but every time i do, it reappears on my desktop, even after I empty/secure empty the trash.

    I want to delete a folder but every time i do, it reappears on my desktop, even after I empty/secure empty the trash.

    I contracted Security Tool the same way about ten minutes ago on my Win7 Home Premium laptop. Firefox prompted me to do an immediate update the way it normally does, with a convincing update screen that looks like the typical Mozilla update prompt. However, the installer I downloaded was in fact "Security Tool." The program firewalls Firefox to prevent searches and also prevents access to Task Manager via Ctrl-Alt-Del. On the surface this appears to be a particularly nasty strain of malware / scamware, and FF users need to be warned and/or innoculated immediately.

  • Exchange email issues (remote search and deleted items folder)

    I use an exchange account on my Q10 and there is two huge problems about it. - the remote search will find email that are at most 60 days old, anything older can't be found on the Q10. I have added the same exchange account to my iPad and iPhone 5 where I can search for several year old email. - the "deleted items" folder won't sync on the Q10. So whenever I delete an email on any device (including the Q10) it gets moved to deleted items. But the Q10 where the folder is empty because it does not sync. (Issue has been confirmed from several people on crackberry forums)  

    I'm currently experience the same situations with my Q10. It seems like doesn't sync the folder immediately even if you select the refresh option.yoomy wrote:
    I use an exchange account on my Q10 and there is two huge problems about it. - the remote search will find email that are at most 60 days old, anything older can't be found on the Q10. I have added the same exchange account to my iPad and iPhone 5 where I can search for several year old email. - the "deleted items" folder won't sync on the Q10. So whenever I delete an email on any device (including the Q10) it gets moved to deleted items. But the Q10 where the folder is empty because it does not sync. (Issue has been confirmed from several people on crackberry forums)  

  • Deleted playlist folder accidently

    I think I know the answer to this, but it can't hurt to ask again...
    itunes Match had two playlist folders of the same name showing up on iOS devices, but not my mac.  I wanted to get rid of one of them, so I deleted the one that showed 0 items at the top level playlist screen in iOs.  Turns out that was the wrong one.  :-(  Now I've lost playlists from 2004-05 time frame.  :-(  Of course that delete sync'd immediately across all my devices, so the folder full of playlists is probably gone forever.
    Normally I would go into TimeMachine and restore the last copy.  But, unfortunately, I had a problem on my readynas yesterday, and had to start TM over from the very beginning.  Only about 90GB of 1.2 TB has backed up, and not the iTunes library.  :-(
    I was hoping the old libraries in "previous itunes libraries" might be useful, but it appears they are not.
    Any ideas?
    Thanks,
    Sean

    Hmm actually using one of the old libraries may just work afterall....

  • How to delete the folder in ABAP

    Hi all,
    i am dowmloading one text file into a one particular folder using GUI_download function module. and whenever we are downloading the text files to that particular folder i have to check whether the folder is exist or not, if that folder is existing then i have to delete that folder and i have to put the text file into new folder.
    Note: for Folder creation am using some OOPs concepts , so any body plz send me the code ASAP.
    BALU.

    http://help.sap.com/saphelp_nw04s/helpdata/en/dc/f1783fe3263042e10000000a114084/content.htm
    http://javaalmanac.com/egs/java.io/CopyFile.html?l=rel
    http://javaalmanac.com/egs/java.io/DeleteFile.html
    http://schmidt.devlib.org/java/copy-file.html
    try {
         File inputFile = new File("C:
    test
    fold1
    abc.txt");
         File outputFile = new File("C:
    test
    fold2
    def.txt");
         FileInputStream in = new FileInputStream(inputFile);
         FileOutputStream out = new FileOutputStream(outputFile);
         FileChannel inc = in.getChannel();
         FileChannel outc = out.getChannel();
         inc.transferTo(0, inc.size(), outc);
         inc.close();
         outc.close();
         in.close();
         out.close();
         boolean fileDeleteSuccess = inputFile.delete();
         if(!fileDeleteSuccess)
              System.out.println("File couldnot be deleted");
         else
              System.out.println("File deleted!!");
         } catch (FileNotFoundException e) {
         e.printStackTrace();
         } catch (IOException e) {
         e.printStackTrace();

  • Please Help!! I deleted the folder System en Macintosh HD and now when i on my mac it says Disk Error Press Any  Key To Restart Please HELP !!

    I deleted the folder System en Macintosh HD and now when i on my mac it says Disk Error Press Any  Key To Restart Please HELP !!

    Reinstall Mac OS X.
    (59450)

  • ITunes deletes symlinked folder on Album Artist rename

    Hello community,
    I experience a very strange behavior of iTunes in combination with Symlinked folders. I use Windows 7 and my folder structure is listed below. I have a Laptop with a 256GB SSD and instead DVD-Drive a 640GB SATA drive.
    Drive layout:
    C: System (Windows Drive)
    D: UserProfile (also symlinked to D:\Username
    E: Media
    My iTunes DB is about 170GB large including media of all kind. I spread the iTunes Media subfolders among several drive, because I want iTunes to start up very fast, but playing music and syncing my iPhone would not benefit from the fast SSD Drive so I don't want to waste the valuable fast space.
    Now when I change the Album Artist of an album iTunes kills/deletes my Music symlink folder after completing the first rename and show the rest of the album as missing files (with the ! in front)
    I have discovered that this only happens when iTunes tries to rename/move folders like it does if the Album artist is changed.
    I have already tried restricting the permission to the symlinked folder to read even with deny write permissions, but it manages to delete the folder everytime.
    I have used a folder junction instead also. All without joy.
    The owner of the folder is the Administrators group which my user is a member of. There are several reason I cannot work a a regular user and I do not want to change that.
    So did anyone experience this and knows why this is the case? I would be glad to know. Thanks for everybody investing a thought
    Sorry for this text monster, but this really bugs me.
    Best regards Bruce
    P.S. Maybe Apple will here my whining and look into this behavior also.
    +Directory of C:\Users\Username\Music (actually D:\Username\Music)+
    +2010-09-28 13:12 <DIR> .+
    +2010-09-28 13:12 <DIR> ..+
    +2010-09-27 16:43 <SYMLINKD> iTunes [d:\iTunes]+
    +0 File(s) 0 bytes+
    +3 Dir(s) 146,808,844,288 bytes free+
    +C:\Users\Username\Music>dir itunes+
    +Volume in drive C has no label.+
    +Volume Serial Number is B022-C44F+
    +Directory of C:\Users\Username\Music\itunes+
    +2010-10-02 23:41 <DIR> .+
    +2010-10-02 23:41 <DIR> ..+
    +2010-10-02 23:41 <DIR> Album Artwork+
    +2010-10-02 23:41 1,007,616 iTunes Library Extras.itdb+
    +2010-10-02 18:33 72,208,384 iTunes Library Genius.itdb+
    +2010-10-02 23:32 5,963,887 iTunes Library.itl+
    +2010-10-02 23:30 29,777,149 iTunes Library.xml+
    +2010-10-02 23:29 <DIR> iTunes Media+
    +2010-09-27 16:45 <DIR> Previous iTunes Libraries+
    +4 File(s) 108,957,036 bytes+
    +5 Dir(s) 146,808,844,288 bytes free+
    +C:\Users\Username\Music>dir "itunes\iTunes Media"+
    +Volume in drive C has no label.+
    +Volume Serial Number is B022-C44F+
    +Directory of C:\Users\Username\Music\itunes\iTunes Media+
    +2010-10-02 23:29 <DIR> .+
    +2010-10-02 23:29 <DIR> ..+
    +2010-09-27 16:07 <SYMLINKD> Audiobooks [e:\iTunes\iTunes Media\Audiobook+
    s]
    +2010-09-27 16:03 <DIR> Automatically Add to iTunes+
    +2010-10-02 21:53 <DIR> Downloads+
    +2010-10-02 23:14 <DIR> Mobile Applications+
    +This folder gets deleted.+
    +2010-10-02 23:29 <SYMLINKD> Music [e:\iTunes\iTunes Media\Music]+
    +2010-09-27 16:08 <SYMLINKD> Podcasts [e:\iTunes\iTunes Media\Podcasts]+
    +2010-09-27 16:03 <DIR> Ringtones+
    +2010-09-27 16:09 <SYMLINKD> TV Shows [e:\iTunes\iTunes Media\TV Shows]+

    Hi, welcome to Apple Discussions.
    iTunes and symlinks don't play nicely... They work OK as long as iTunes is only reading data but get all confused when iTunes tries to write back. I recommend you just put the whole library on a drive big enough to hold it all in one go.
    tt2

  • Items are not moved to the deleted items folder when they expire

    Hey
    I have Exchange 2010 Server (Version: 14.01.0438.000) and configured a retention policy with one retention tag for the
    inbox that moves items after 365 days to the deleted items folder. I have assigned this policy to one Mailbox to see if it works. It doesn't. :)
    All Items are "stamped" correctly with a expiry date. And the Messages show now "This item is expired" for example:
    I made the Policy a week ago and waited to see if the items will be moved but nothing happen until today. The Application Log shows no errors or warnings. I already used "Start-ManagedFolderAssistant"
    multiple times....
    what is wrong here? And how do i track the problem down?
    i also checked all the other threads regarding the same or alike issues. But couldn't find anything that would halp me.

    Get-RetentionPolicyTag
    Get-RetentionPolicyTag:
    RunspaceId                      : bab19777-67ac-4a28-a895-19f89113122a
    MessageClassDisplayName         : All Mailbox Content
    MessageClass                    : *
    Description                     : Managed Content Settings
    RetentionEnabled                : True
    RetentionAction                 : MoveToDeletedItems
    AgeLimitForRetention            : 365.00:00:00
    MoveToDestinationFolder         :
    TriggerForRetention             : WhenDelivered
    MessageFormatForJournaling      : UseTnef
    JournalingEnabled               : False
    AddressForJournaling            :
    LabelForJournaling              :
    Type                            : Inbox
    SystemTag                       : False
    LocalizedRetentionPolicyTagName : {}
    Comment                         :
    RetentionId                     : 6c115c72-8186-4828-b801-d434d7fdbcc7
    LocalizedComment                : {}
    MustDisplayCommentEnabled       : False
    LegacyManagedFolder             :
    AdminDisplayName                :
    ExchangeVersion                 : 1.0 (0.0.0.0)
    Name                            : Delete after 1 year (Inbox)
    DistinguishedName               : CN=Delete after 1 year (Inbox),CN=Retention Policy Tag Container,CN=****
                                       AG,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=****,DC=*****
    Identity                        : Delete after 1 year (Inbox)
    Guid                            : 6c115c72-8186-4828-b801-d434d7fdbcc7
    ObjectCategory                  : *****/Configuration/Schema/ms-Exch-ELC-Folder
    ObjectClass                     : {top, msExchELCFolder}
    WhenChanged                     : 07.10.2014 10:16:04
    WhenCreated                     : 07.10.2014 10:16:04
    WhenChangedUTC                  : 07.10.2014 08:16:04
    WhenCreatedUTC                  : 07.10.2014 08:16:04
    OrganizationId                  :
    OriginatingServer               : srv-********
    IsValid                         : True
    Get-RetentionPolicy:
    RunspaceId              : bab19777-67ac-4a28-a895-19f89113122a
    RetentionId             : a83b8845-5f3b-422c-84a1-8eef8a8b2bd2
    RetentionPolicyTagLinks : {Delete after 1 year (Inbox)}
    AdminDisplayName        :
    ExchangeVersion         : 1.0 (0.0.0.0)
    Name                    : Funds@
    DistinguishedName       : CN=Funds@,CN=Retention Policies Container,CN=*****,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=***,DC=****
    Identity                : Funds@
    Guid                    : a83b8845-5f3b-422c-84a1-8eef8a8b2bd2
    ObjectCategory          : hnw.dom/Configuration/Schema/ms-Exch-Mailbox-Recipient-Template
    ObjectClass             : {top, msExchRecipientTemplate, msExchMailboxRecipientTemplate}
    WhenChanged             : 07.10.2014 10:28:26
    WhenCreated             : 07.10.2014 10:28:26
    WhenChangedUTC          : 07.10.2014 08:28:26
    WhenCreatedUTC          : 07.10.2014 08:28:26
    OrganizationId          :
    OriginatingServer       : srv-******
    IsValid                 : True
    I just replaced some "critical information" with *****
    Also the Policy is defently applied. I checked with:
    Get-Mailbox -ResultSize unlimited | Format-Table Name,RetentionPolicy -Auto

  • Unable to delete a folder under Artists and albums...

    Hi..Im not able to delete a folder under Artists and albums in the music player. When deleting im getting msg as "File is Corrupted. Operation Cancelled". Can somebody suggest me how to get rid of the folder??

    Connect phone to computer with usb cable (select mass storage mode) and try to delete folders using computer's file manager.

  • Finder resets itself to default local folder when I delete a folder from a server. How can I stop this?

    Hello there,
    At work I use a Mac Pro (like this one: http://www.everymac.com/systems/apple/mac_pro/specs/mac-pro-quad-core-2.8-2008-s pecs.html)... and I have a very weird problem that is really annoying.
    I don't have the information (but I can get it tomorrow) on the operating system or any information of the server I am having the issues with. But I was hoping maybe some one else with the same issue might have the answer without all of that information.
    We use the server to access, open, edit, save, delete, move, etc... all of the files we are currently working on.  No files are ever transfered to our local computer's hardrive and then copied back to the server (don't ask me why, and don't tell me to do that, this is how it's done in the office, and this is what I have to do)...
    The issue is this.  When I have to delete a folder from the server, which is usually a folder within a folder, and maybe within another folder, and another, and another (meaning it takes me time to look for this), the Finder deltes the folder (and asks if I am sure I  want to delete it, because it will be deleted forever since I am deleting it from the server)... and when I say yes, the Finder window that I am currently on (the folder which contains the folder that I am deleting) reverts back to the initial "device-folder" for my local mac pro... meaning the folder which is the main folder of that mac pro, where I can see the mac pro's hard drive, any external hardrives, any usb pen drives, any cds, etc...
    So EVERY TIME I delete a folder on the server, which is more than 30 times a day, I get "kicked out" of the foler which contains the folder to be deleted, and gows back to tha "main" folder of my computer, so I have to go back to the server, back to the folder, and sometimes it is a folder, within a folder, within a folder, etc, etc, etc, ... and don't tell me the solution is to create a shortcut on my sidebar for that folder, because the folders are the jobs that I may be working on that day, so I could work on as many as 30 different folders per day, and I do have those in my sidebar, but it is still pretty annoying to have to go back to that folder.
    One thing I noticed... SOMETIMES, not all the times... IF I delete two folders instead of one, it won't do it... or IF I drag the folder to the trash, instead of clicking on my "delete" icon on my finder's toolbar, it won't do it... but this is only SOMETIMES. So these are not the solutions either.
    I can try to get a screen cap tomorrow of the issue, but if anyone has this same issue and knows how to fix it, plese let me know.
    I will also try to get more info on my computers OS and the server.
    Thank you,
    MW

    Hi PCM1, if i understand well the problem you have is when you click on a URL in a pdf file, the link opens in IE ? Have you checked in the default programs panel to see if all was well set ?

  • How to delete a folder in Documents To Go.

    I've created a folder in Documents To called Song Lyrics. In that folder I have several 100 songs with lyrics. Now I want to delete the folder but there is no delete button. I can delete each song individually but that doesn't delete the folder itself. How can I delete the folder?

    I'm no expert when it comes to Docs To Go but I'm wondering if pressing and holding the folder for a second or two will bring up a Delete option. Just a thought.
    Cheers.  
    - If my response has helped you, please click "Options" beside my post and mark it as solved. Clicking the "thumbs up" icon near the bottom of my response would also be appreciated.

  • How to delete a folder in yahoo mail

    how to delete a folder in yahoo mail

    What folder are you trying to delete?
    Mail/Mailbox/Delete Mailbox.

  • How to delete the folder VOLUMES on the main drive?

    Leopard creates a folder called Volumes on the root with aliases to external hard disks. I can delete the folder but as soon as I connect to the local network server, the folder Volumes appears again with an alias to the hard disk in the server. How do I permanently delete this folder? My Dock grid list is totally ruined by this folder. I was used to 5 folders on the root. Now it's six and I don't want that. I never had this annoying folder and I didnt do anything except for the 10.5.4 update. I also have no file or folder sharing active. The Volume folder also (re)appears when I connect an external USB disk. pls help

    A problem I have with this folder is that although it is an alias, sometimes when I do file transfers (such as receiving large amounts of photographs via pando etc.), as well as downloading the file to the external drive, as I have instructed it, is stashes the same file in the "Volumes" folder, and over time it can really start to eat away at the disc space. (I only recently discovered this recently and was this able to free up about 12 GB of disk space). I am pretty sure this is abnormal behavior for this folder, but I don't have any idea where to look to find what the problem is. Any idea what might be causing this, and how I can stop it doing it? It isn't catastrophic, now that I know, because I can periodically go and clear it out, but the eroding disk space caused me lots of problems until I discovered that this is what was causing it.

  • How to delete the Folder from sql server 2008

    Hi all,
    I was trying to delete the folder from sql server 2008 with the below script
    DECLARE @path VARCHAR(256) -- path for backup files
    DECLARE @cmd VARCHAR(8000)
    DECLARE @folderName VARCHAR(256) -- filename for backup
    SET @folderName = + (CONVERT(varchar(10), GETDATE()-7, 112))  -- 7 days back date folder name
    SET @path = 'I:\Backup_Test\' + @folderName -- Folder path
    SET @cmd = 'del ' + @path -- Delete
    EXEC master..xp_cmdshell @cmd
    --Print @cmd
    This is not working it was asking the Confirmation (I:\Backup_Test\20100629\*, Are you sure (Y/N)? ) what will i do to the delete the folder.
    Thanks,
    Prasad R.

    I would notice   you that T-SQL does not play well to do things like that. Do not you want using .net language to delete folders?
    Old method is
    declare @HR int, @CFOLDER varchar(255),@FSO int
        set @CFOLDER='D:\folder\'
        EXEC @HR = sp_OACreate 'Scripting.FileSystemObject', @FSO OUT
        EXEC @HR = sp_OAMethod @FSO, null, 'DeleteFolder', @CFOLDER 
    Now regarding to your second question please examine xp_fileexist  system stored procedure
    CREATE FUNCTION dbo.fn_file_exists(@filename VARCHAR(300))
      RETURNS INT
    AS
    BEGIN
      DECLARE @file_exists AS INT
      EXEC master..xp_fileexist @filename, @file_exists OUTPUT
      RETURN @file_exists
    END
    GO
    -- test
    SELECT dbo.fn_file_exists('c:\a.txt')
    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/

Maybe you are looking for

  • IMovie Text and Presets Not Working?

    iMovie 11 isn't working properly. The text(Titles) shows up fine on preview but once you're out of the editing thing it shows the text plus random black backgrounds on it. Also, with some of the presets (the animated clips in iMovie) won't work prope

  • Tolerance Limit in MIRO...

    Dear All, How to setup the tolerance limits for a user to enter MIRO invoices to 2% greater than the line amount of a Purchase order and no limit for less than the line amount. Regards, Shashank. Edited by: Shashank on Sep 21, 2010 5:31 PM

  • Spilt tea on my MacBook Pro, please help!

    Im really upset with myself for letting this happen, I learnt the lesson of not having liquids by electronics the hard way.... Basically, I placed my cup of tea (with milk and sugar in it) next to my MacBook Pro and accidentally knocked my cup over t

  • Instant client for SQLLDR

    I see Oracle provides several instant client downloads. Is there a SQLLDR instant client, or a lite version that doesn't require the whole Oracle client for Linux (both 64 and 32 bit)?

  • Concurrent accessing of a static method

    Hi, We have an online application, which has some methods in the middle tier that have been declared as "static". Application is running fine with less number of users but when the load is increasing the application is crashing with a core dump. The