While deleting folder in Window OS it shows error : THE FOLDER IS DOESN’T EXIST - cmd

For Example :
suppose I have a directory like "C:\Users\user\Downloads\Compressed\Developing Android Apps Videos"
Now while deleting "Developing Android Apps Videos" folder, If an error popped up with this message that "FOLDER DOESN'T EXIST", How to fix such issue ???

you have to follow this steps to solve this issue:
open cmd administration
enter command -> cd /d C:\Users\MK\Downloads\Compressed\Developing Android Apps Videos
enter command -> dir /x
After the 3rd step, you can see some folder name and you need to use that name for 5th step.
enter command -> rmdir /q /s enter-folder-name
Hopefully, this could help you and please find an attachment for the exact process.
Thank you

You can try below command also.
1.Open command prompt
2.Run below command
RD /S /Q pathOfTheFolder
ex: RD /S /Q C:\Users\Me\Documents\NewFolder
Here
/S- Delete all sub folders and files. So once you delete any folder, all files and folders with in that folder will be deleted
/Q - Doesn't show Yes/No confirmation dialog box before deleting files are folders.

Related

TortoiseSVN client-side hooks in project properties (delete cache files)

I have several php-projects under SVN control. I want to delete compiled php-template files after update on the client side; these files are located in ./tmp/smarty/compile folder. So using windows command line I can do this using
del /Q path_to_my_project\tmp\smarty\compile
If I run this command in cmd.exe all files are successfully deleted.
using projects properties tsvn:postupdatehook I should use %REPOROOT% placeholder for project path. so my command becomes:
del /Q %REPOROOT%\tmp\smarty\compile
del is the cmd.exe command, so I need to run cmd.exe first and then run desired command. so finally my hook command looks like:
cmd.exe /c del /Q %REPOROOT%\tmp\smarty\compile
when I run this using Win+R (with reporoot changed to full path) it works fine too.
Then I put this line to SVN properties (I should replace \ slashes to /, overwise SNV returns http-path to repository, not local path), and try to update project. TortoiseSVN asks me if I want to run hook:
cmd.exe /c del /Q D:\_projects\webCakePHP\.....\tmp\smarty\compile
So here reporoot is successfully translated to correct working copy path.
Everything looks fine, but when I run this hook, it successfully deletes files in tmp\smarty\compile but it also deletes all files from working copy dir.
the question is, what am I doing wrong, and how to delete files after update right way.
I've tried to put quotes some ways but it doesn't delete enything at all or says that there is no such directory.
thanks
as an alternate solution to my question, i've created .bat file in %REPOROOT%/bin folder, which deletes files:
pushd %~dp0..\tmp\smarty\compile
del /Q *
popd
and my hook cmd string is %REPOROOT%/bin/clearCache.bat.
this is not exact answer to my question because it requires bat-file creation and isn't one-line hook.

Deleting entire folder in Visual Studio Post-build event

I'm trying to delete a folder in my output directory using the following command line:
del /F "$(TargetDir)Content\"
Tho I always end up exiting with error code 1. I've tried several different ways, without /F, with/without slash both before and after, etc.
Error 1 The command "del /F "E:\proj\bin\Windows\Debug\Content\"" exited with code 1.
There are a lot of questions regarding deleting files in post-build event command lines in visual studio, which works fine, but I can't seem to delete a folder without getting code 1.
Any help is appreciated!
RD /S /Q "Full Path of Folder"
In your case:
RD /S /Q "$(TargetDir)Content\"
Browse to the same folder using Command Prompt, and then run that command and see what the actual error is. Might be permissions or something is in use.

Batch program to delete a folder

I'm trying to automate a little backup process of a folder from the computer to a network-drive. I found the code below to delete the folder on the network drive but I can't get it working because it says "Unable to find the specified file" for each files that it tries to remove. Why?
rd /s /q "\\MY SERVER\mysharename\myfolder"
Maybe there is a problem with concepts. It is not "\\server\folder", but "\\server\shareName". And you can not remove the share with a rd command.

How can I delete a folder using CMD utitilty in Windows XP?

I have a folder without any file in it in my external hard. I am able to rename it, but not able to delete it. I ran CMD utility as an administrator and I tried the commands "del foldername", "rd foldername", "deltree foldername" (the last one was not allowed in Windows XP). They give me the message "Access is denied." for "rd foldername". How can I delete it?
I am not cmd guru, but simple as 1-2-3 is delete folder using system account.
at 11:11pm /interactive cmd
Now if system command appear, delete folder:
del foldername
try
attrib /s foldername
This should show you the directory attributes.
If the response is
R x:\dirname
then the directory is "read-only". In that case, execute
attrib -r foldername
and you should then be able to rd it.
It may be that the directory has (possibly hidden, possibly read-only) contents. The attrib /s should show these to you.

How can I delete a folder which it can't be done easily?

There is a folder named Recycler in the directory of my external hard drive and it has a subfolder named cvx which I cannot delete it. I used cmd to do this. I wanted to change it using attrib -h -s /d /s, but it reported Access Denied -L:\Recycler\cvx, I also tried to delete it using del cvx, but it couldn't be done. Could you help me with this?
Thank you in advance.
Access Denied sounds like a permissions issue.
takeown /f L:\Recycler /r /d y
icacls L:\Recycler /grant administrators:F /t
rd /s/q "L:\Recycler\cvx"
You could try to change the access permissions using the dialog in windows explorer
Right-click a file or folder > properties
Open "security" tab
Click edit button
Click on current user's name
Ensure "full control" "allow" box is checked
Click "ok"
Click "ok"
Attempts to delete should be made easier by that.

Resources