1.

Solve : cant delete hidden file?

Answer»

@ECHO OFF
attrib *.* -R -H -S
echo Y | del f:\folder1\ *.*>nul
EXIT

what's wrong with the code?
it deletes files on specified folder but not hidden files.
any suggestion? You may need to use
delayed execution
You can search for that term on this forum and find examples of when it is needed.

The expression
attrib *.* -R -H -S
is not a recommended usage. It is much too BROAD in SCOPE and time-consuming. It should be using only as need for a specific directory tree.Quote from: night-rider on May 14, 2010, 09:02:02 PM

@ECHO OFF
attrib *.* -R -H -S
echo Y | del f:\folder1\ *.*>nul
EXIT

what's wrong with the code?
it deletes files on specified folder but not hidden files.
any suggestion?

the main person to do that would be the administator of the computerQuote from: night-rider on May 14, 2010, 09:02:02 PM
@ECHO OFF
attrib *.* -R -H -S
echo Y | del f:\folder1\ *.*>nul
EXIT

what's wrong with the code?
it deletes files on specified folder but not hidden files.
any suggestion?

Depends on the current directory. The attrib command operates on the current directory unless otherwise specified.

Code: [SELECT]@echo off
attrib f:\folder\*.* -R -H -S
echo Y | del f:\folder1\*.* > nul
exit

I doubt it's a permissions issue. I suspect the attrib and del commands ran against two different directories.

Good luck. Correction to previous post:

Code: [Select]@echo off
attrib f:\folder1\*.* -R -H -S
echo Y | del f:\folder1\*.* > nul
exit

Sorry for any confusion.
actually I already solved my problem about this topic.
but THANKS anyway for the lesson!!! I used the rmdir command!you can use the http://www.filehippo.com/download_unlocker unlocker program which deletes such files...


Discussion

No Comment Found