Turn Windows Notepad into a document management expert

  
The average person only uses Windows Notepad for simple text recording. However, in the hands of people, it can be used to manage files, and often more convenient and efficient than operating in a windowed environment. Can Notepad also manage files? This seems to be a matter of Arabian Nights, but in the office Xiao Li is a piece of cake. Xiao Li uses Notepad to manage files with some simple commands built into the system, even the Explorer and any other tools are not needed. Do you believe? Case: Quick migration and copying of batch files There are many subfolders in Xiao Li's data folder. In these folders, there are DOC files in Word format, XSL files in Excel format, and some other formats. file. When arranging the files, Xiao Li hopes to copy all the DOC format files into separate ones. For this task, Xiao Li borrowed Notepad and completed it with a simple command: XCOPY *.DOC /SE:\\MYDOCBAK After saving, save the TXT file extension to BAT and double-click the file, so the current file The folder and the DOC type files under the subfolders of the next level are copied to the MYDOCBAK folder of the E drive, and the original directory structure is maintained. Among them, the parameter /S means to include the level directory and the sub-directories of each level (except the empty directory) when copying the file of the specified type. Tip: The above is a command to copy a type of file. If Xiao Li wants to migrate a batch of files, then just use the migration file command MOVE in Notepad (Figure 1). Case: Multi-level folder management Multi-level folder creation in batches Xiao Li should create a data folder group containing each department and each employee under it in the data folder on the company server. The following sub-folders of the five departments, under the sub-folders of each department, contain sub-subfolders named after each employee name of the department. There are a lot of people, and it is very troublesome to build one by one in the Windows Explorer window with the usual thinking! Of course, Xiao Li can't fall into the cliché. He still uses Notepad and only creates a TXT file. First, create a TXT file in the server data folder, for example, Builder.TXT”. Open the “Generator.TXT” file and enter the following command in it: MD Finance Division Planning Division Production Division Supply Division Labor Department CD Finance Division MD Zhang San Li Si Wang Wu Zhao Liu … … (Note: Some of the department names are omitted here , the names of people are separated by a half-width space) CD..MD Planning Section MD Zhang Hong Li Green Wang Bai Zhao Zi … … (Note: omit a number of CD). Next, imitate the above method, input used to Create MD commands for the other three departments and employee folders. After the entry is completed, the file extension TXT is modified to be a BAT file after saving. Finally, execute “Builder.BAT”, look under the data folder, all the required folders are generated. Tip: The above operation is actually a tedious folder creation process in the resource manager for the very simple notepad typing process. Only two simple English commands, MD and CD, need to be entered. The rest of the department name and personnel name that need to be entered, because the office generally has a text list of its ready-made names, which are usually copied directly, separated by a half-width space. The batch deletion of the designated folder has hundreds of personnel in this department. After the economic crisis, the layoffs have gone a group of people. After the data of these people is backed up, Xiao Li needs to delete the folders left by the people and pick them out one by one. It is obviously too much trouble to delete, what should I do? To delete a folder with a known name, just create a TXT file in the department folder, then enter an RD command inside, followed by a half-width space, and then enter or import the name of the person to be deleted (the name is used in the middle) Separate the half-width space, and finally enter the /S /Q parameter (Note: there are half-width spaces before the two slashes) (Figure 2), save the file extension to BAT after saving, execute this file, all need to be deleted The name folder is deleted. Tip: Interpretation of MD, CD, RD commands MD is an internal command of the Windows system for creating folders. It is an abbreviation of the MKDIR command, which is equivalent to the two. The command format is: MD [drive:]path means a folder that creates a path in a drive. If you are creating a side-by-side folder, you can enter the folder names consecutively, separated by a half-width space. The CD command is short for the CHDIR command and is used to enter a folder. CD.. is returned to the upper folder, CD\\ is returned to the root directory. If you use the /D command line switch on the command line, you can change the current drive in addition to changing the current directory of the drive. The RD command is short for the RMDIR command and is used to delete folders. If the parameter /S is used, in addition to deleting the directory itself, all subdirectories and files in the specified directory will be deleted, which can be used to delete the directory tree. Use the parameter /Q to indicate that the delete mode is quiet mode, so that if you use the /S parameter to delete the directory tree, the system does not require confirmation, and the deletion can be automated. Case: The rapid generation of the list of file lists Xiao Li's colleague Xiao Wang computer has more than 500 boutique PDF e-books, the e-book file names are the names of the books. One day, Xiao Wang’s friend got to know what e-books Xiao Wang had collected and asked Xiao Wang to pass her a catalogue. After Xiao Wang opened the resource manager, he was dumbfounded. How to send the catalog of more than 500 books to friends? Need to find tools or download and install software? Xiao Li said that it is not necessary to use notepad to complete this matter. I saw Xiao Li set up a TXT file in the e-book folder. Then she entered the following line in the command: DIR *.PDF /ON /B >BOOKLIST.TXT Next, she changed the TXT list. For BAT, then double-click on the BAT file, and in a blink of an eye, a BOOKLIST.TXT directory file is generated. It was as simple as this, Xiao Wang immediately sent this file to a friend. Tip: DIR commands and parameter descriptions The DIR command is used to display the names of files and subfolders in a folder. It has many parameters (Figure 3) that can implement very complex and variable file or directory display and output, even hidden system files can be operated, much more convenient than window operations. The /ON parameter we used in the above command means that the list is sorted by file name order, where O is English “sort & rdquo; the first letter of the word, N is the initial letter of English “name” . The parameter /B means to use the empty format, that is, the list does not have title information or file summary information (because we only need the file name here, do not care about other irrelevant summary information of the file, so use this command to filter out irrelevant information). > BOOKLIST.TXT is output redirection, which can output the content originally displayed from the window to the BOOKLIST.TXT file. To complete this task, Xiao Li has another option, which is to use the TREE command. She simply needs to adapt the line in Notepad to TREE /F > BOOKLIST.TXT. The list file BOOKLIST.TXT obtained in this way, the files inside are arranged by the directory tree. If there are subordinate folders in the e-book folder, they will be listed in the form of a tree structure at a glance. TREE's original meaning is "tree", this command means to list the directory tree below the current folder, /F parameter is to display the file list (the first letter of File), so it is particularly easy to remember. Case: Setting or canceling restrictions on file operations For security reasons, Xiao Li sometimes adds some read-only attributes to archive files, even with implicit attributes. For example: Xiao Li wants to set all DOC archive files in the current directory to read-only properties, and also hide all PPT files. These operations are cumbersome to operate in the Explorer window, especially when it comes to implicit property operations. You also need to set the open or remove hidden file properties in the system folder options. You have to use the same trouble when you want to display them. The method is set back. It would be much simpler to use Notepad instead. For these two operations, just enter two simple commands in Notepad: ATTRIB +R *.DOCATTRIB +H *.PPT Save the file to the BAT file after saving, and execute the BAT file. To cancel these properties, simply change the + sign in the above two commands to a - sign. Tip: The ATTRIB command indicates the properties of the modified file. The available parameters for this command include R (read-only attribute), H (implicit attribute), S (system file attribute), and A (archive file attribute). You can also use the /S parameter to process the files in the subdirectory together, with the /D parameter indicating that the properties of the folder are also set together (Figure 4). This article comes from [System Home] www.xp85.com
Copyright © Windows knowledge All Rights Reserved