Custom .bat .cmd files creation help.

Page 2 of 2 FirstFirst 12

  1. Posts : 14
    Windows 7 Pro 64-bit
    Thread Starter
       #11

    Thanks guys. I will look into this. One more thing: is there a batch file command to delete all files named i.e "XYZ.EXT" on whole drive "C:\" and subfolders? For example if I wanted to delete all *.tmp files on C:\ without pointing to each folder and subfolder.
      My Computer


  2. Posts : 742
    MS Windows 7 Ultimate 64-bit SP1
       #12

    This is the help for del command on Command window or in a batch file.

    C:\>del /?
    Deletes one or more files.
    DEL [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
    ERASE [/P] [/F] [/S] [/Q] [/A[[:]attributes]] names
    names Specifies a list of one or more files or directories.
    Wildcards may be used to delete multiple files. If a
    directory is specified, all files within the directory
    will be deleted.
    /P Prompts for confirmation before deleting each file.
    /F Force deleting of read-only files.
    /S Delete specified files from all subdirectories.
    /Q Quiet mode, do not ask if ok to delete on global wildcard
    /A Selects files to delete based on attributes
    attributes R Read-only files S System files
    H Hidden files A Files ready for archiving
    - Prefix meaning not
    If Command Extensions are enabled DEL and ERASE change as follows:
    The display semantics of the /S switch are reversed in that it shows
    you only the files that are deleted, not the ones it could not find.

    You can use the command
    Del C:\*.tmp /S /Q

    to delete all the temp files with extension tmp on C: drive and all the subdirectories (/S) and without asking you for confirmation (/Q).

    To change the drive replace C: with the correct drive letter.
      My Computer


  3. Posts : 14
    Windows 7 Pro 64-bit
    Thread Starter
       #13

    Okay,
    How do I delete the "desktop.ini" files. I've tried the line
    "del /s /q /F "C:\desktop.ini" and it doesn't work. It deletes only some of the desktop.ini files not all of them (not talking about the Windows protected desktop.ini files).
      My Computer


  4. Posts : 742
    MS Windows 7 Ultimate 64-bit SP1
       #14

    Desktop.ini files are used for customizing things like the folder's icon and localized name. Usually they have a system and hidden attributes set so that they are not visible.These files are small files and does not take up much space and best left alone.

    I used to clean the desktop.ini and thumbs.db in Windows XP very religiously. But got fed-up as these files are getting created by windows again on next reboot. Hence just set the protected operating system files to be hidden and show hidden files and folders....(out of sight - out of mind). In Windows 7 I stopped bothering about these files.

    If you still wants to delete these files try the below commands.
    attrib -h -s C:\desktop.ini /S
    del C:\desktop.ini /S /Q
      My Computer


  5. Posts : 126
    Windows 7 Pro 32bit / Windows 7 Professional
       #15

    If ANY of the sytem files bother me, it's those damn thumbs.db files. Trying to delete a folder that contains (or even contained) any type a graphic - especially across systems - one computer to another - is a PITA.

    STILL: Windows 7 is a good OS and the thumbs data bases help speed up browsing folders. INI files are important too, and store display information. I find it best to NOT display hidden files, and also keep hidden protected files and Windows seems to function pretty well. Only when I am really re-arranging things do the thumbs files give me grief.

    Best Wishes, and be careful with that DEL command,
    Rªnce
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:43.
Find Us