![]() ![]() Should this behave differently for a directory vs. ' First remove readonly attribute, if setĪgain, I'll leave the error handling to you and again these are the things I'd consider: If FileExists(FileToDelete) Then 'See above Here's a function for you: Sub DeleteFile(ByVal FileToDelete As String) ![]() Basically use the Kill command but you need to allow for the possibility of a file being read-only. Check for a string containing characters illegal in a file name/pathĢ.) How To Delete a File.Check for an empty string being passed.I'll leave it to you to figure out the various error handling needed but these are among the error handling things I'd be considering: ![]() Basically do this: Function FileExists(ByVal FileToTest As String) As Boolean A command window will pop up, execute the command and close again, and there you go, a new drive pops up in explorer.1.) Check here. If you are in explorer at the right path, just type in subst j. :)ĮDIT2: Okay, this trick can be expanded even further. From the Explorer window where you have trouble, click the address bar so you can type in it, then type cmd and press Enter to start a command prompt at that location, then proceed at step 3. Return to your cmd window and type subst /d j: to remove the drive or alternatively, restart your pc.ĮDIT: A trick I learned which can shorten this quite a bit.Go to it and do whatever you need to do to the. Now in Explorer, you have a new drive letter in This PC.Use cd to navigate to the folder you want to go (you can use tab to autocomplete names.Start a command prompt (no admin privileges needed).The reason this works is because the path itself is no longer containing >255 chars. You should now be able to rename/delete/etc them. Then go to the new drive letter and navigate to the files that have long names. What I always do is use subst to create a drive letter association with part of the path. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |