DOS: Unterschied zwischen den Versionen
Aus Claudio's Wiki
(Die Seite wurde neu angelegt: =cmd= Einfach ein paar Notizen ; Löschen mehrerer Ordner gleichzeitig zuerst eine 'Ausführungsliste' erstellen <code> dir /AD /B | find "14.06.2009" > dellist.txt <...) |
(→cmd) |
||
Zeile 18: | Zeile 18: | ||
</code> | </code> | ||
<br /><br /> | <br /><br /> | ||
+ | |||
+ | |||
+ | ==DOS Befehle== | ||
+ | |||
+ | ;rmdir | ||
+ | Removes (deletes) a directory. | ||
+ | <code> | ||
+ | RMDIR [/S] [/Q] [drive:]path | ||
+ | RD [/S] [/Q] [drive:]path | ||
+ | |||
+ | /S Removes all directories and files in the specified directory | ||
+ | in addition to the directory itself. Used to remove a directory | ||
+ | tree. | ||
+ | |||
+ | /Q Quiet mode, do not ask if ok to remove a directory tree with /S | ||
+ | </code> | ||
+ | |||
+ | ;dir | ||
+ | Displays a list of files and subdirectories in a directory. | ||
+ | <code> | ||
+ | DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] | ||
+ | [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4] | ||
+ | |||
+ | [drive:][path][filename] | ||
+ | Specifies drive, directory, and/or files to list. | ||
+ | |||
+ | /A Displays files with specified attributes. | ||
+ | attributes D Directories R Read-only files | ||
+ | H Hidden files A Files ready for archiving | ||
+ | S System files - Prefix meaning not | ||
+ | /B Uses bare format (no heading information or summary). | ||
+ | /C Display the thousand separator in file sizes. This is the | ||
+ | default. Use /-C to disable display of separator. | ||
+ | /D Same as wide but files are list sorted by column. | ||
+ | /L Uses lowercase. | ||
+ | /N New long list format where filenames are on the far right. | ||
+ | /O List by files in sorted order. | ||
+ | sortorder N By name (alphabetic) S By size (smallest first) | ||
+ | E By extension (alphabetic) D By date/time (oldest first) | ||
+ | G Group directories first - Prefix to reverse order | ||
+ | /P Pauses after each screenful of information. | ||
+ | /Q Display the owner of the file. | ||
+ | /S Displays files in specified directory and all subdirectories. | ||
+ | /T Controls which time field displayed or used for sorting | ||
+ | timefield C Creation | ||
+ | A Last Access | ||
+ | W Last Written | ||
+ | /W Uses wide list format. | ||
+ | /X This displays the short names generated for non-8dot3 file | ||
+ | names. The format is that of /N with the short name inserted | ||
+ | before the long name. If no short name is present, blanks are | ||
+ | displayed in its place. | ||
+ | /4 Displays four-digit years | ||
+ | |||
+ | Switches may be preset in the DIRCMD environment variable. Override | ||
+ | preset switches by prefixing any switch with - (hyphen)--for example, /-W. | ||
+ | </code> | ||
+ | |||
+ | ;find | ||
+ | Searches for a text string in a file or files. | ||
+ | <code> | ||
+ | FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]] | ||
+ | |||
+ | /V Displays all lines NOT containing the specified string. | ||
+ | /C Displays only the count of lines containing the string. | ||
+ | /N Displays line numbers with the displayed lines. | ||
+ | /I Ignores the case of characters when searching for the string. | ||
+ | /OFF[LINE] Do not skip files with offline attribute set. | ||
+ | "string" Specifies the text string to find. | ||
+ | [drive:][path]filename | ||
+ | Specifies a file or files to search. | ||
+ | |||
+ | If a path is not specified, FIND searches the text typed at the prompt or piped from another command. | ||
+ | </code> | ||
+ | <br /> |
Version vom 18. Juni 2009, 17:09 Uhr
cmd
Einfach ein paar Notizen
- Löschen mehrerer Ordner gleichzeitig
zuerst eine 'Ausführungsliste' erstellen
dir /AD /B | find "14.06.2009" > dellist.txt
liste testen
for /F "delims=" %I in (dellist.txt) do @Echo %I
nun die Ausführungsliste abarbeiten
for /F "delims=" %I in (dellist.txt) do rmdir /S /Q "%I"
DOS Befehle
- rmdir
Removes (deletes) a directory.
RMDIR [/S] [/Q] [drive:]path RD [/S] [/Q] [drive:]path /S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree. /Q Quiet mode, do not ask if ok to remove a directory tree with /S
- dir
Displays a list of files and subdirectories in a directory.
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4] [drive:][path][filename] Specifies drive, directory, and/or files to list. /A Displays files with specified attributes. attributes D Directories R Read-only files H Hidden files A Files ready for archiving S System files - Prefix meaning not /B Uses bare format (no heading information or summary). /C Display the thousand separator in file sizes. This is the default. Use /-C to disable display of separator. /D Same as wide but files are list sorted by column. /L Uses lowercase. /N New long list format where filenames are on the far right. /O List by files in sorted order. sortorder N By name (alphabetic) S By size (smallest first) E By extension (alphabetic) D By date/time (oldest first) G Group directories first - Prefix to reverse order /P Pauses after each screenful of information. /Q Display the owner of the file. /S Displays files in specified directory and all subdirectories. /T Controls which time field displayed or used for sorting timefield C Creation A Last Access W Last Written /W Uses wide list format. /X This displays the short names generated for non-8dot3 file names. The format is that of /N with the short name inserted before the long name. If no short name is present, blanks are displayed in its place. /4 Displays four-digit years Switches may be preset in the DIRCMD environment variable. Override preset switches by prefixing any switch with - (hyphen)--for example, /-W.
- find
Searches for a text string in a file or files.
FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]] /V Displays all lines NOT containing the specified string. /C Displays only the count of lines containing the string. /N Displays line numbers with the displayed lines. /I Ignores the case of characters when searching for the string. /OFF[LINE] Do not skip files with offline attribute set. "string" Specifies the text string to find. [drive:][path]filename Specifies a file or files to search. If a path is not specified, FIND searches the text typed at the prompt or piped from another command.