How to delete all files and folders (with files) in IsolatedStorage.

Hi awesome programmer:-) The code I have to clean up the local folder doesn't work properly so I won't even bother posting it here. I basically want to have a "master reset" option to remove all new created files and folder in the local folder.
Can you give me simple code to remove all files/folder so the app goes back to the state it was when the user installed it for the first time? Thanks in advance. ps I were able to delete a directory(-ies) with this method:
private async void DeleteDirectory(string directoryName)
try
var folder = await Windows.Storage.ApplicationData.Current.LocalFolder.GetFolderAsync(directoryName);
if (folder != null)
await folder.DeleteAsync();
this.Dispatcher.BeginInvoke(delegate()
txtUpdateFeed.Text = "Folder < " + directoryName + " > deleted.";
catch (Exception ex)
this.Dispatcher.BeginInvoke(delegate()
txtUpdateFeed.Text = "Delete Directory << " + directoryName + " >> Error: " + ex.GetBaseException().Message.ToString();
It seems to work, I have not tested with all conditions though. Anyway let me put up the code so you can see I have been trying: This is to delete everything but not all files are deleted:
private void WipeAllData(bool bln)
try
txtUpdateFeed.Text = "Removing files...";
if (bln)
txtUpdateFeed.Text = "Removing folders...";
//Delete videos directory
DeleteDirectory("videos");
//Delete pictures directory
DeleteDirectory("pictures");
txtUpdateFeed.Text = "Folders removed.";
//Delete the rest of the files
var iso = IsolatedStorageFile.GetUserStoreForApplication();
foreach (string name in iso.GetFileNames())
iso.DeleteFile(name);
BtnWipeAllData.Content = "Wipe All Data";
VideoCameraPowerValue = "on";
BtnVideoCameraPower.Content = "Video Camera: ON";
PhotoCameraPowerValue = "on";
BtnPhotoCameraPower.Content = "Photo Camera: ON";
txtUpdateFeed.Text = "Files removed successfully.";
catch (Exception ex)
MessageBox.Show("Wipe All Data Error:\n" + ex.Message.ToString());
Why isn't all files being deleted?

Hi Clint William Theron,
Based on your descriptions, I know that when you run the above code, it does not delete all the files, then have you checked that which kinds of files or in which folder the files can not been deleted?
Besides, if you want to let the app go back to the state it was when the user installed it for the first time, then an easy way is to uninstall and reinstall it.
Best Regards,
Amy Peng
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to delete all bookmarks and replace with backup?

    Trying to sync my new iPad with my MacBook Pro and iPhone via MobileMe has created some fun new problems. For starters: I now have a full set of duplicate Safari bookmarks. Two of everything.
    Fortunately, I (think) I made a safe backup before performing the fateful merge (suggested by Sync) that caused the duplicates. So now I'd like to delete ALL my bookmarks and re-import the saved backup bookmarks.
    But I can't figure out how to delete all my bookmarks at once. It looks like my only choice is to delete them one at a time. Is there some way to simply trash the entire bookmarks file and re-import the ones I saved?

    HI Adam,
    You can use Safari Prairiefire to find duplicate Safari Bookmarks.
    http://www.balooba.se/baloobasoftware/index.html
    After you install the software which you can use in demo version to do this click the Get Bookmarks tab. Then from the menu click: Tools / Check Duplicates.
    I've had the same thing happen using my MobileMe account also.
    Carolyn

  • How to delete all projects and accompanied files from Adobe Premeiere Elements 13

    I would like to delete all projects and files and start anew, but I cannot find a clear enough instruction how to do it. Please help'

    vitprod
    Same other versions as well.
    There is no one delete button that wipes away the project file (.prel) and the project's assets. You need to go to the save locations of the project file (.prel) and its assets and delete
    each one by one wherever they are saved UNLESS you pre-plan and, before the project is created, set up a particular project so that the project file with assets goes to its own folder instead of each component of the project going into a common place for Premiere Elements files and folder where you have to pick out the materials for deletion one by one by name.
    Answers
    Default type situation
    If left at defaults and if your Premiere Elements 13 is running on Windows 7, 8, or 8.1 64 bit, go to Libraries/Documents/Adobe/Premiere Elements/13.0 and, in the 13.0 Folder, delete standalone files with your target project's name and delete files with your target project's name in the folders found in the 13.0 Folder.
    Plan Ahead
    Edit Menu/Preference/Scratch Disks - Set all to Same As Project.
    Create a new folder at a hard drive location of choice.Then point the project file to that folder for the Save In.
    Tip: When the Expert workspace of the new project opens, go to File Menu/Save As. Name the project and set the new folder created as the Save In of the Save Project dialog.
    Please review and consider and then let us know if any of that worked for you.
    Thanks.
    ATR

  • Replace all references to files and folders with lowercase in web documents on a site

    Hi I'm working on a test server that runs Ubuntu Unix (but my PC which has Dreamweaver CC is running Windows 8.1). I would like to search and replace in Dreamweaver to change all src and href attribute values inside files (webpages, css, etc.) on my site to lowercase, but with the folder and file names' spelling otherwise unchanged. I already changed the names of the actual files and folders, but wanted to make all references in my files point to them again. I started to use regular expressions in the specific tag search, but I was not sure how to specify letter case conversion on a backtracked value. Some flavors of RegEx allow you to replace a searched value in parentheses with its lowercase counterpart by specifying something like this: \L\1
    Where \L converts the character captured in the reference \1 to lowercase. Thanks.

    Hi Jon,
    Thanks for your response. Yes, I tried. But I’m not sure you can use any RegEx special characters in the replacement text. I put in \L0 and it just replaced the match with the literal string, so href=”Support/Index.HTML” became href=”\L0”
    What I want is href=”support/index.html”
    The reason I didn’t use Dreamweaver to change the actual file and folder names is I have images widely dispersed in subfolders. I didn’t think Dreamweaver would automate that part—I think you can only select a file individually to rename it, and then DW will correct all references to it. But probably can’t rename everything with one command from the root. Well, this is turning out harder than I thought.
    Let me know if you have any other ideas.
    Thanks,
    Dave.

  • How to delete all contacts and calendar events?

    I had previously told my iPod Touch to sync my contacts, calendars, and e-mail accounts with my computer (Mac) and sync via MobileMe. Now, I'm giving away my iPod Touch and I don't want to new owners to have access to my calendar, contacts, and mail. I've gotten rid of the mail by deleting all my accounts, and in iTunes I've stopped syncing of calendars, contacts, and mail, but there's still my contacts and calendar on my iPod. Is this because of MobileMe or just because it didn't take them off the iPod? How can I stop MobileMe syncing to my iPod Touch and get rid of my contacts and calendars off my iPod without having to just go one by one and delete them?

    Delete an account from iPod touch: Choose “Settings > Mail, Contacts, Calendars,” choose an account, then scroll down and tap Delete Account.
    Deleting an account means you can no longer access the account with your iPod touch. All email and the contacts, calendar, and bookmark information synced with the account are removed from iPod touch. However, deleting an account doesn’t remove the account or its associated information from your computer.

  • I downloaded the trial version of LR 5 just to get a feel of LR 5. However, now that I have bought it, it has all my photos in a mess and I need to delete all photos and start with a blank LR...Help!

    How do I save my photos and then reimport them??

    You can create a new catalog which will be empty File->New Catalog. There is no SAVE command in Lightroom, so in general you don't need to SAVE your photos. If you have done some editing of the photos, and you want that to show up in the new catalog, select the photos and then Ctrl/Cmd-S to save the metadata with the photos.
    If all your photos are "in a mess" (whatever that means), you might consider learning how to organize in Lightroom by getting rid of that mess using Lightroom methods. But generally, if you are beginning and your photos are all "in a mess", then creating a new catalog and importing again will result in the same mess. You would need to identify what you did wrong, and fix that.

  • Managing files and folders with Pegasus R6

    Sorry if this seems like a really newbie question, but it has me stumped.  Oh, and hello everyone! This is my first post on here.
    I just purchased a new 27" iMac and the new Pegasus R6 (12TB) drive.  So now I am getting prepared to offload my old iMac with all the pictures and videos that have caused it to nearly grind to a Windows speed.
    My software is Aperture 2, Adobe CS4 and Final Cut Studio express.
    On to my question... Once I had all the software installed, and the Pegasus drive was done setting up (overnight), I dragged the Aperture 2 library over to the Pegasus drive.  It surprised me to see that the orginal library stayed on my iMac and a duplicate was now on the Pegasus drive.  I thought that maybe it was just a nuance in the way Aperture is.  So, I took a couple of photos that were just sitting in the iMac under a newly created folder and dragged and dropped those into the Pegasus drive.  Viola', those copied as well.  Now I have a copy on the iMac and the Pegasus.  I cannot figure out why the items are not moving, but duplicating.
    Any thoughts?

    Sorry if this seems like a really newbie question, but it has me stumped.  Oh, and hello everyone! This is my first post on here.
    I just purchased a new 27" iMac and the new Pegasus R6 (12TB) drive.  So now I am getting prepared to offload my old iMac with all the pictures and videos that have caused it to nearly grind to a Windows speed.
    My software is Aperture 2, Adobe CS4 and Final Cut Studio express.
    On to my question... Once I had all the software installed, and the Pegasus drive was done setting up (overnight), I dragged the Aperture 2 library over to the Pegasus drive.  It surprised me to see that the orginal library stayed on my iMac and a duplicate was now on the Pegasus drive.  I thought that maybe it was just a nuance in the way Aperture is.  So, I took a couple of photos that were just sitting in the iMac under a newly created folder and dragged and dropped those into the Pegasus drive.  Viola', those copied as well.  Now I have a copy on the iMac and the Pegasus.  I cannot figure out why the items are not moving, but duplicating.
    Any thoughts?

  • How to delete all photos and start over

    is it possible to delete everything in i-photo and start over again from scratch.  I have dvd copies of everything, I want to start over just like the first time I opened the program.
    new albums, new folders, ect---I really screwed up everything and want to start over

    Just go into the pictures folder and delete the iPhoto Library. The next time you start iPhoto it will create a new one.
    Just in case, you might want to rename it instead. That way you can still access the old library if you have to. When you find that you don't need it, you can delete it.

  • HT1923 This article contains the only thing that worked for me.  I also had to sign out of iCloud and uninstall it.  Then I had to delete all files and folders from all of those applications that were under Program Files, Program Files x86, and Users.

    This article contains the only thing that worked for me.  I also had to sign out of iCloud and uninstall it.  Then I had to delete all files and folders from all of those applications that were under Program Files, Program Files x86, Program Data and Users.  My iPhone 4 will now sync with iTunes both in its USB-connected  mini dock and over Wi-Fi.  It's unfortunate (negligent programming on the part of Apple?) that the upgrade to iTunes 11 did not remove all of those files as part of the upgrade process. 

    I am having the same issue....Same address for years - same as USPS - I tried 5 times (3 macs and 2 iPhones) and now i have 5 CHARGES for 1.00 each on my credit card. I took the credit card info off so they don't charge me anymore. How can they charge me yet still not allow me to download free updates and say I have an invalid address? I'm sure I will spend weeks or months trying to get a credit out of these incompetent idiots.

  • How can I get iTUNES library to display renamed files and folders (renamed with Windows Explorer)?

    How can I get iTunes library to display the new names and organisation of tracks and albums (ie files and folders) that I have renamed and reorganised (using Windows Explorer) having previously imported them using iTunes?
    (Even when I relocate "lost" tracks in iTunes (using the drop down menu facility to view in Windows explorer), although iTunes will then play the track, and knows where to find it, it refuses to display the track with its correct (new) name, or show it the correct (new) album.  That means I have lots of things called "Untitled" and "Track 01" etc, all of which have actually been renamed, but iTunes does not seem to have the capability to recognise the changes and update its library listing.  Another example - a Tchaikovsky CD with 3 major works in 13 tracks insists on displaying in iTunes as 13 tracks in one album, despite the fact that I have reorganised the tracks into 3 albums - two being Swan Lake and The Nutcracker - and renamed the individual tracks to a more useable format.)

    Thanks for your replies ckuan
    I agree with Tgod that your first solution does not work.  It appears unpredictable whether the old or new file names are listed when you drag the folders into iTunes from Windows Explorer.  The folder structure is completely missing.  I reckon if you have to muck around spending days/weeks/months finding out how to fix links to a secret meta-file (obviously designed by some deep-cover microsoft worm working in the Apple!), then it's pretty obvious that almost any alternate way of doing this would be better.   Bye bye iTunes!!
    Incidentally, I tried several other things that (if the software was designed intuitively) should work, but give disastrous results:
    1) when deleting the library listing in iTunes, it gives you two options - one is to remove the listings to the Recycler.  Be aware that IF you select that option, it removes not only your library listing, but also your ACTUAL MUSIC FILES to the Recycler.  Moreover, it does NOT remove the insidious secret meta-file that is what apparently keeps rewriting old names over your carefully renamed file names, and keeps totally ignoring your carefully designed folder (album) structure.  OK - not a complete disaster, as I realised and went hunting through the chaos in the Recycler to recover all my files.  No thanks to the genius who designed this brilliant feature!
    2) after deleting the library listing in iTunes, I attempted to import just the folders that I wanted.  iTunes refused to allow me to do that, and proceeded to try to import every frigging music file it could find on my whole hard drive, in apparently random fashion into the library.  Whoever thought up that doozy either never ever tried to use or market test it, or has modified their mind rather too many times with artificial substances so their brain is like muesli chop suey.
    3) oh why go on, it's too depressing ...

  • Uninstall the application does not delete all new files and folders.

    If the user decides to uninstall my Air app, it does not delete the created folders with files in AppData. Another problem is that if the application creates new files in the folder Program Files/AirAppFolder, then uninstall of the app are not deleted these files.
    How to solve these problems, help please?

    Hi,
    AIR shouldn't be creating additional files in your program files folder, is this something you're doing programmatically?  If so, you might want to consider using File.applicationStorageDirectory instead given permission problems you'll have on newer operating systems.
    As to uninstalling all files (even the data created in the user's storage folder) this is something you might consider using a native installer to take care of.  Since the AIR installer is unaware of this data, it won't know to delete it on uninstall.  Instead, you'll want to create a custom function in a native installer that deletes these folders/files and then sub launches the AIR install/uninstall.
    Thanks,
    Chris

  • With my taking any action, my folders and files no longer appear under documents (under Places). Now a folder titled Documents has appeared on my desktop with all my files and folders. What happened?What happened?

    With my taking any action, my folders and files no longer appear under documents (under Places). Now a folder titled Documents has appeared on my desktop with all my files and folders. What happened?What happened?

    The way I moved from 10.3.9 to 10.5.8 was to use "ditto -rsrc" and copy the user homes and the data share to an external firewire drive. Then did the same in reverse.
    I found the key to data and share permissions to make sure that the users had the same UID in Leopard that they had in Panther.
    You can then use "sudo rm -rf" to remove any folder from the relocated homes that you want. Remember if you do choose to remove "~/Library" from each users relocated home, you will be removing any iCal calendars, login.keychains, browser bookmarks, custom screensavers and wallpapers, etc.
    Users don't really care if they can login and do any work. But there will be much wailing, gnashing of the teeth, and anxiety, if they lose their bookmarks and wallpaper.

  • HT204053 I have a school ipad with iCloud using a different ID (my school email address) . I am leaving and want to buy my own ipad and transfer all my data and docs to my personal iCloud account but don't know how to do this without deleting all data and

    I have a school ipad with iCloud using a different ID (my school email address) . I am leaving and want to buy my own ipad and transfer all my data and docs to my personal iCloud account but don't know how to do this without deleting all data and photos?

    Heya Katie!!
    So, the article you have there, HT4895, is pretty good. Just look at the FAQ section of it.
    But basically, you will want to create a backup on your computer through iTunes...Just plug your current iPad into it and make sure your iPad and iTunes are logged in with the same Apple ID. At that point, just create a backup.
    When you get your new iPad, and before you plug it in or set it up, follow the directions in this link to change your Apple ID. http://support.apple.com/kb/HT5621?viewlocale=en_US
    Once you have that done, plug your new iPad into your computer to sync up with iTunes. Follow the directions for Restore from Backup and it should bring all that info back to your new iPad.
    And changing your Apple ID email info will allow you to have your own!!! This should solve all your issues and GL!!!

  • My documents on ipad 3 closes everytime I try to open it.it happened after I did an update last week.all my files and folders seem to be lost.how can I fix this?

    What can I do my documents keep closing when I tried to open it i have updated it last week and now it seems like it is not working.what cud the problem be?

    Can you start Firefox in [[Safe mode]] ?
    You can also do a clean reinstall and download a fresh Firefox copy from http://www.mozilla.com/firefox/all.html and save the file to the desktop.
    Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    You can initially skip the step to create a new profile, that may not necessary for this issue.
    See http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • How can I sort all files and folders by size?

    Due to lack of space I need to find the biggest files and folders on my Mac OSX Mountain Lion, but "Size" is not in the Find options.
    And I don't know the wildcard to sort all files and folders by size in Easyfind.
    Thanks
    Sarah

    There are applications out there which are designed to show you files and the space they use.  Some of these applications and some strategies for making more room on your disk are given below.
    Freeing Up Hard Disk Space
    Freeing space on your Mac OS X startup disk
    Clearing Disk Space on Your Mac
    Seven ways to free up drive space

Maybe you are looking for