|
||
|
As PCWeek's NET ADVISOR columnist Neil Plotnick remarked in his 5/11/98 article, "Must be that ol' DOS magic":
Renaming Files Batch renaming files in a single directory can be simple using rename (or ren). It requires only the use of a wildcard in the command:
(which would give all HTM files in the current directory the HTML extension) If you want to batch rename files across directories and sub-directories, you can use the FOR command (which runs a specified command for each file in a set of files) with the /R (for recursive) switch:
Note: PC Magazine's June 9, 1998 issue features a new freeware utility add-on for Explorer called MultiRen, which lets you rename multiple files by first selecting them in Explorer, then selecting MultiRen from the right-click menu. Parsing Text Files The FOR command is good for working with a set of files across directories using any NT command, including NT's findstr command (which searches files for a text string):
Note that the findstr command can use literals as well as regular expressions, so you could search for HTML tags around specific text, for example. See the NT Help file for more information about findstr switches. Don't forget NT's graphical Find dialog (available from the Start menu), which parses files for strings rather quickly: it can be much easier to set up sets of files (search in files by file type, date, etc) using the graphical Find than the findstr command, and the results list is in an Explorer window, so you can easily open or otherwise manipulate file results in a familiar setting. Deleting Files If you want to delete files by extension across directories (great for housekeeping chores), try this command (which in this case would delete all BAK and TMP files):
Go To Page: 1 2
The copyright of the article Command Line Usage in Windows NT Workstation is owned by . Permission to republish Command Line Usage in print or online must be granted by the author in writing.
|
||
|
|
||
|
|
||