home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,414 of 42,547   
   Todd Vargo to Daniel Rafflenbeul   
   Re: Delete files ith or without attribs   
   19 Jan 16 21:30:55   
   
   From: tlvargo@sbcglobal.netz   
      
   On 1/19/2016 7:10 PM, Daniel Rafflenbeul wrote:   
   > Hy to all here..   
   >   
   > how can i write a batch to delete files like :   
   >   
   > del *.sfv /S   
   > del *.nfo /S   
   > del *.rtf /S   
   > del *.folder.jpg /S   
   > del *.ini /S   
   >   
   >   
   > But, some of them are hiden or not writable , read only.   
   > how can i delete them everywhere ?   
   >   
   > del *.folder.jpg /S /A:HR    ?   
   > Delete the file even though st hidden and or read only  ?!   
      
   The fastest and easiest way to find out what works is to try it. Create   
   a test folder with a few files. Create a sub folder with a few files.   
   Then test the command on that folder.   
      
   ** At Windows XP command prompt **   
      
   C:\>md test   
      
   C:\>cd test   
      
   C:\test>echo.>a.sfv   
      
   C:\test>echo.>a.nfo   
      
   C:\test>echo.>a.ini   
      
   C:\test>md test2   
      
   C:\test>copy *.* test2   
   a.ini   
   a.nfo   
   a.sfv   
            3 file(s) copied.   
      
   C:\test>dir /a-d/s/b   
   C:\test\a.ini   
   C:\test\a.nfo   
   C:\test\a.sfv   
   C:\test\test2\a.ini   
   C:\test\test2\a.nfo   
   C:\test\test2\a.sfv   
      
   C:\test>attrib +h a.ini   
      
   C:\test>attrib +h test2\a.ini   
      
   C:\test>del /a/s/f *.ini   
   Deleted file - C:\test\a.ini   
   Deleted file - C:\test\test2\a.ini   
      
   C:\test>dir /a-d/s/b   
   C:\test\a.nfo   
   C:\test\a.sfv   
   C:\test\test2\a.nfo   
   C:\test\test2\a.sfv   
      
      
   --   
   Todd Vargo   
   (Post questions to group only. Remove "z" to email personal messages)   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca