July 31, 2017

How to Delete Folders with Long Paths that Windows Can't Delete

How to Delete Folders with Long Paths that Windows Can't Delete


The horror of “Cannot delete [file name]: The file name you specified is not valid or too long. 
Specify a different file name
 
Hello every one and welcome to another post to Explain something that you may or may not know already.

How to Delete Folders with Long Paths that Microsoft Windows Operating Systems (GUI) do not know how to handle.


Background;

Sometimes Some Programs can create deep long paths of folders and files that exceed the 256 characters that Microsoft Operating Systems don't know how to handle (User interface Wise).

For Example;
  1. if you are using a software application that categorizes your Pictures by multiple categories like Date Picture taken and name of First Tagged Person and Street name from Geo Tags which could lead to a very long name like; "C:\users\username\My Pictures\2017.07.31\My Brothers Long Name\My Street Name from Geotagging which is a bit longer than usual\The final File name which consists of the date and time as part of the name and maybe the geolocation street name too.jpg" This example shows how easy it is to have a path that exceeds the default max of 256 characters.
  2. When you are using a music tagger / organizer like "Music Brains Picard" and for example try to tag a classical album this for sure will lead to the same problem.

SO, WHAT TO DO,

Well for me I suffered from these multiple times and I will list underneath possible resolutions in no particular order of difficulty.

  1. If you only have a couple of folders and/or files you can try to rename them to short names at that point you will be able to delete easily
      1. “C:\Long folder name\Another long folder name\and another\and another\long file name too.jpg”
      2. Start renaming from top to bottom every long name rename to 1 or 2 letters or numbers and travers down and then you will be able to delete them easily.
  2. If you find it easy to boot from an external Boot Disk with a Live Linux Distro you can just navigate to the folder location and delete the folders you want to delete then boot to windows normally after and all will be well. "The only Down Side is if you (Like Me) have your files on a Raid Array (Specially Fake Raid or Mother Board Provided free Raid) at that point your Linux distribution might not easily recognize the Raid Drive thus making it more time consuming to let your Linux read the Raid Array so it is easier to try other solutions.
  3. You can Use 7Zip which is a totally free application to Un Compress files like *.RAR, *.ZIP, …etc.  From within the application navigate to the folder in question and Press “SHIFT and DELETE” not the delete button only as delete button will use the windows delete and will not be able to accomplish what is needed but when you click the “SHIFT and DELETE” combo the application itself can do that for you.  You can check out this YouTube video https://www.youtube.com/watch?v=qQTyTprFAOg which was not created by me so props to the author for it which shows you an example in a very easy way.
  4. And here we come to the magic trick “ROBOCOPY” which is built in windows so no need to install anything, I discovered this solution from SuperUser technical forum https://superuser.com/questions/78434/how-to-delete-directories-with-path-names-too-long-for-normal-delete reply number 74 explained it excellently and I will summaries underneath;
    1. Let’s say you have a very long pathed folder called “C:\Very Long Path Folder that I want to delete”
    2. Create an empty folder on lets call it delete
      1. (mkdir C:\del)
    3. Copy and update the date from the empty directory/folder to the Folder that you want cleansed. 😊
      1. (Robocopy C:\del “C:\Very Long Path Folder that I want to delete” /purge)
      2. The switch /purge will copy and update the folder as the source folder which was already empty.
    4. Now you can delete your empty directories / folders easily with no fuss.
    5. Since there are no files or folders in the source directory (C:\del), it simply deletes the files and folders under the target directory (C:\Very Long Path Folder that I want to delete) recursively!

So now you know it.


I did not re-invent the wheel, this was the efforts of others and since it took me long to find out how I decided to summarize all in one topic and tried my best to give props to those who had articles or steps for doing so.

June 18, 2016

Egypt and the Digital Age

Will Egypt Catch Up to the Digital Era??

When we live in a country where you are contemplating to purchasing Netflix for 12$ since it is Cheaper than OSN cheapest bundle but can't because the internet is weak and limited (Even the Unlimited package but that is another story that will get into later).

When we live in a country where by Online Education / Courses in various materials and subjects are available for free from either freelancers / volunteers, and even official accredited universities like MIT and the like but you can't get access to it since it requires more bandwidth / download limit it is really a shame.

When online jobs are really available (real ones not scams) but you do not have access to for your low bandwidth / download limit, really a shame.

When you can't even play an online game since Egypt is blacklisted or blocked due to its bad reputation, or you do have access but can't play due to its latency and HIGH ping and lag, Shame.

When you have the option / opportunity / chance to attend online courses and seminars but can't due to the extreme lag and packet delay that you reply to questions asked 10 minutes ago. Really a shame.

All this and here in Egypt we pay the highest prices although Egypt is considered the communication Hub for the Middle East and Africa since a big percentage of marine cables pass through Egyptian waters coming from Europe to the neighboring areas.

Price Comparison between Egypt and USA when it comes to Unlimited packages.

Will compare Between TE-Data since it is monopolizing the market and is giving to all other ISPs (Internet Service Providers) in Egypt and it subsequently offers the highest FUP (Fair Usage Policy) limit on the Unlimited packages (Do not ask me how a limit on Unlimited packages but welcome to Egypt and monopoly).


TE-Data 2 MBs connection based on 1/4 (upload/Download) is equal to 220 L.E. per month for the unlimited package (with 250-300 GBs limit on the UNLIMITED PACKAGE) means that you can download up to 2 Mbs per second (200 KBs of data per second) and Upload 512 Kbs per second (50 KBs of data per second) at a rate of 220 Egyptian Pounds a month and you can't exceed 250GBs of downloaded / uploaded data per month.
The upload rate does not increase more that 1Mbs (100 KBs per second) in any of its packages that is targeting home users even if you got the 24 Mbs (2.4 MBs of data per second) and in order to get higher upload speed to have to go to their enterprise packages which the data for is not publically available.

on the contrary, as per USInternet
for 30 USD $ (Less than 300 L.E.) you can get a download / upload speed of 25 Mbs unlimited bandwidth per month and for 40 USD $ (less than 400 L.E.) you can 100 Mbs unlimited bandwidth.

so basically 12 times the speed for a 50 % increase on what TE-Data gives us in charity. and 50 times the speed for double of what TE-Data charge us for their measly 2 Mbs connection and they say unlimited (in false representation which is a criminal act and punishable by law if it was not politicized).

So please understand that you are getting nothing for a lot of money and things need to be changed.

If only a smart, well informed, and honest lawyer takes it upon himself / herself to file a law suite against TE-Data using their own contracts / Web Sites for false representation that would be helpful for all of Egypt if we really want an educated population that can really take Egypt to the light of education and prosperity.

Long Live Egypt and the Egyptians.

January 13, 2016

"Humanitarian Aid" A Poem by Motaz Hefny





I was walking in a distant land,      fooling around while feeling grand
I saw her sitting on the grace,      feeling all the worlds' rash
She saw me coming and said hi,      in a low tone and a sad cry
She was a refugee in her own land,      where the expats feel grand
They give the people false aid,      and show the world what they have made
The displaced are in a complete loss,      while every one feels the boss
What they need is a friendly smile,      and they get a charity rime
They want to live in peace,      while the givers prosper in grace
The war must go on so they can thrive,      on Mother Nature's hideous ride
Mischief dwells the land,      while death stretch the hand
One hand gives with a yellow smile,      and the other beat for a mile
Aid should go to the fighting band,      so they will eat their own hand
Pray with me for the blood to stop,      before the refugee's die and drop