Deleting files that give an error of “The filename or extension is too long”

del 0-Namespace-https???next-services.apps.microsoft.com?browse?6.2.9200-1?670?en-US?c?AU?Namespace?pc?00000000-0000-0000-0000-000000000000?00000000-0000-0000-0000-000000000000.dat
The filename or extension is too long.

Cleaning up after a Windows 8 restore and had problems deleting some files. According to KB320081 one possible way was to “Use an auto-generated 8.3 name to access the file”. After some searching I found what this means thanks to this post (it annoys me to no end that lot’s of posts just copy and pasted the details in the KB320081 page and don’t explain how to use the 8.3 name for deleting stuff). So the 8.3 name is the first 6 letters of the file name appended with a ~1 with any similar files will have an incremented number (~2, ~3, etc) as shown below.

1. My Chicagotech A.doc => MYchic~1.DOC
2. My Chicagotech B.doc => MYchic~2.DOC

I used this to help delete some files but even that didn’t manage to delete some files. In the end a “del name*” helped

C:\Windows.old\Users\Tim\AppData\Local\Packages\WinStore_cw5n1h2txyewy\AC\Microsoft\Windows Store\Cache>dir
 Volume in drive C is Windows8

 Directory of C:\Windows.old\Users\Tim\AppData\Local\Packages\WinStore_cw5n1h2txyewy\AC\Microsoft\Windows Store\Cache

13/Apr/2014 16:09 <DIR> .
13/Apr/2014 16:09 <DIR> ..
01/Nov/2013 21:35 5,578 0-Namespace-https???next-services.apps.microsoft.com?browse?6.2.9200-1?670?en-US?c?AU?Namespace?pc?00000000-0000-0000-0000-000000000000?00000000-0000-0000-0000-000000000000.dat
28/Oct/2013 13:04 5,578 0-Namespace-https???next-services.apps.microsoft.com?browse?6.2.9200-1?670?en-US?c?GB?Namespace?pc?00000000-0000-0000-0000-000000000000?00000000-0000-0000-0000-000000000000.dat
27/Oct/2013 18:42 5,574 0-Namespace-https???services.apps.microsoft.com?browse?6.2.9200-1?615?en-GB.en-US?c?GB?Namespace?pc?00000000-0000-0000-0000-000000000000?00000000-0000-0000-0000-000000000000.dat
01/Nov/2013 21:35 474 0-ProductTileExtendedByProductGuidForOS-https???next-services.apps.microsoft.com?browse?6.2.9200-1?670?en-US_en-US.en?c?AU?OsUpgrade?0a295e4d-5f14-4b44-9c2e-c98177f9e2f4?pt?x64.dat

del 0-Prod~1.dat   # worked

del 0-Name~1.dat   # didn't work
Could Not Find C:\Windows.old\Users\Tim\AppData\Local\Packages\WinStore_cw5n1h2txyewy\AC\Microsoft\Windows Store\Cache-Name~1.dat

del 0-Name*        # worked
Advertisements

Deleting Windows Services

In the process of installing MySQL I ran into a few errors leaving me with an added service that didn’t work. So now had to remove it:

In a command prompt (Start > Run > type "cmd", enter), type the following:

sc delete serviceName

Notes:

  • Ensure you use the Service Name, not the Display Name, i.e. in the

    Service Name vs Display Name
  • Ensure the service is stopped
    • Go to Service listing. This can be done in the following ways:
    • Start > Run > type "services.msc", enter

      or
    • Right click "My Computer" (XP) or "Computer" (Vista onwards)

      > Manage > Services and Applications (in left pane) > Services
  • Find the service and stop it
  • This was done on Windows 7 RC, thus item names may differ in XP / Vista