How to delete files in hidden directory? - windows

I want to delete all files having a name starting with liste_concepteur_matiere :
del C:\liste_concepteur_matiere*.pdf /S
The problem is that when the file is located in AppData\Local\Temp\ then I get access denied error. So how to enable deletion of those files ?

Try to open cmd like administrator:
right click on its icon and "run as administrator".

Related

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

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.

Delete a shortcut using "erase" or "del" commands in cmd.exe

When I try to delete folder shortcuts from command prompt it deletes the target folder contents.
Can anyone help me to find another way to just delete shortcut?
Thanks to Christian K. I found the answer:
First I created a .lnk file (shortcut) with mklink but when I used del or erase to delete shortcut target file contents deleted. So now we can use rmdir to remove just shortcut.

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.

How to run robocopy as non admin without having to share folders for read/write access - WINDOWS 7

I have a basic bat file which copies files from one directory to another
set SOURCE=\\T4\D$\TV
set DESTINATION=\\T4\E$\TV
robocopy /MIR %SOURCE% %DESTINATION%
When i run as a user (member of the admin group) it just displays the contents of the bat file in a command prompt window on an endless loop.
However when i right click over the bat file and click run as administrator it executes perfectly.
When i right click over the bat file and click properties> compatibility, the option to run as administrator is greyed out for some reason?
I dont really want to share my folders either :)
Any help?
Since you are using the Administrative shares in your for your SOURCE and DESTINATION locations, you would require Admin privileges. Not just for robocopy, but for ANY copy command.
Try going to either location from the RUN command to verify.

Resources