1 / 113

Using ASSOC , FTYPE , ATTRIB , SUBST , XCOPY , EDIT , and DOSKEY

7. Using ASSOC , FTYPE , ATTRIB , SUBST , XCOPY , EDIT , and DOSKEY. ASSOC and FTYPE. Each file extension is associated with a specific filetype . Use ASSOC command to view and modify the link between extension and type.

havard
Télécharger la présentation

Using ASSOC , FTYPE , ATTRIB , SUBST , XCOPY , EDIT , and DOSKEY

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 7 Using ASSOC, FTYPE, ATTRIB, SUBST, XCOPY, EDIT, and DOSKEY Gary DeRoest

  2. ASSOC and FTYPE Each file extension is associated with a specific filetype. Use ASSOC command to view and modify the link between extension and type. Each filetype is associated with an executable program located on a filesystem. Use FTYPE to view and modify the lick between filetype and program. Gary DeRoest

  3. ASSOC Help Page Displays or modifies file extension associations ASSOC [.ext[=[fileType]]] .ext Specifies the file extension to associate the file type with fileType Specifies the file type to associate with the file extension Type ASSOC without parameters to display the current file associations. If ASSOC is invoked with just a file extension, it displays the current file association for that file extension. Specify nothing for the file type and the command will delete the association for the file extension. Gary DeRoest

  4. ASSOC Display all current extension-filetype associations C:\> ASSOC .jpg=jpegfile .mpeg=mpegfile .txt=txtfile .zip=CompressedFolder … Gary DeRoest

  5. ASSOC Display specific extension-filetype association C:\> ASSOC .doc .doc=Word.Document.8 Gary DeRoest

  6. ASSOC Create new extension-filetype association C:\> ASSOC .txt=Word.Document.8 Gary DeRoest

  7. FTYPE Help Page – Part 1 Displays or modifies file types used in file extension associations FTYPE [fileType[=[openCommandString]]] fileType Specifies the file type to examine or change openCommandString Specifies the open command to use when launching files of this type. Type FTYPE without parameters to display the current file types that have open command strings defined. FTYPE is invoked with just a file type, it displays the current open command string for that file type. Specify nothing for the open command string and the FTYPE command will delete the open command string for the file type. Gary DeRoest

  8. FTYPE Help Page – Part 2 Within an open command string %0 or %1 are substituted with the file name being launched through the assocation. %* gets all the parameters and %2 gets the 1st parameter, %3 the second, etc. %~n gets all the remaining parameters starting with the nth parameter, where n may be between 2 and 9, inclusive. For example: ASSOC .pl=PerlScript FTYPE PerlScript=perl.exe %1 %* would allow you to invoke a Perl script as follows: script.pl 1 2 3 If you want to eliminate the need to type the extensions, then do the following: set PATHEXT=.pl;%PATHEXT% and the script could be invoked as follows: script 1 2 3 Gary DeRoest

  9. FTYPE Display all filetype-application associations C:\> FTYPE txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1 Word.Document.8="C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" /n /dde jpegfile=rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen %1 … Gary DeRoest

  10. FTYPE Display specific extension-filetype association C:\> FTYPE Word.Document.8 Gary DeRoest

  11. FTYPE Create new filetype-application association C:\> FTYPE txtfile=C:\programs\textpad.exe Gary DeRoest

  12. ATTRIB Set and display DOS file attributes • R - Read-Only • A - Archive • S - System • H - Hidden • /S • /D • + set • - clear Gary DeRoest

  13. ATTRIB Set an attribute for file in current drive:directory Make the file read-only A:\> ATTRIB +R myfile.txt Setting multiple attributes A:\>ATTRIB +H +S myfile.txt Setting attributes for specified files in current d:d A:\>ATTRIB +A *.txt Gary DeRoest

  14. ATTRIB Set an attribute for file in different drive:directory Make the file read-only A:\> ATTRIB +R C:\DATA\myfile.txt Setting multiple attributes A:\>ATTRIB +H +S DATA\myfile.txt Setting attributes for specified files in current d:d A:\DATA\>ATTRIB +A \*.txt Gary DeRoest

  15. ATTRIB Clear an attribute for file Clear the read-only attribute A:\> ATTRIB -R C:\DATA\myfile.txt Clearing multiple attributes A:\>ATTRIB -H -S DATA\myfile.txt Clearing attributes for specified files A:\DATA\>ATTRIB -A \*.txt Gary DeRoest

  16. ATTRIB • A:\> ATTRIB DATA.TXT • A:\> ATTRIB C:\WUGXP\*.99 • A:\> ATTRIB +R DATA.TXT • A:\> ATTRIB -H C:\IO.SYS • A:\> ATTRIB -S -H -R *.* /S NOTE: DIR /V Gary DeRoest

  17. Folder Options Gary DeRoest

  18. Folder Options Gary DeRoest

  19. Attributes Gary DeRoest

  20. Other File Systems’ Attributes • Rename inhibit • Modify • Compress • Purge immediately • Copy inhibit • Execute • Encrypt Gary DeRoest

  21. SUBST • Substitute a drive letter for a path name • SUBST [drive1: [drive2:] path] • SUBST drive1: /D • SUBST Gary DeRoest

  22. SUBST • Be cautious when using SUBST command with network drives • Never use SUBST drive letters with commands such as LABEL, FORMAT, DISKCOPY, FDISK, RECOVER, DISKCOM, CHKDSK • SUBST A: B:\ Gary DeRoest

  23. XCOPY • Copy files, directories like COPY with many more options • /D:date - copy files modified on or after date • /S - copies directories except empty ones • /E - copies directories including empty ones • /H - copy system and hidden files also • /T - create directory structure but not copy files • /K - copy attributes • /Y - overwrites existing files without prompting Gary DeRoest

  24. XCOPY • XCOPY C:\*.99 A:\*.DTA • XCOPY C:\TEMP\*.* • XCOPY C:\???.* A:\DATA • XCOPY C:\???.* A:\DATA /S /E • XCOPY C:\* A:\DATA /D:05-01-98 /S NOTE: /S /H /R /E /K Gary DeRoest

  25. EDIT • EDIT • EDIT A:\STATES.CAP • EDIT C:WUGXP\SPORTS\FOOT-PRO.TMS Gary DeRoest

  26. EDIT Gary DeRoest

  27. EDIT Gary DeRoest

  28. EDIT Gary DeRoest

  29. EDIT Gary DeRoest

  30. EDIT Gary DeRoest

  31. EDIT Gary DeRoest

  32. EDIT Gary DeRoest

  33. EDIT Gary DeRoest

  34. DOSKEY • TSR • Command history and editing tool • F7 - display • F8 - Search • F9 - Select Gary DeRoest

  35. DOSKEY • DOSKEY /macros • DOSKEY C=CLS • DOSKEY RM=DEL • DOSKEY /history • DOSKEY /macrofile=<filename> Gary DeRoest

  36. 8 Organizing and Managing your Hard Disk Gary DeRoest

  37. Typical Hard-Disk Configuration Gary DeRoest

  38. Disk Organized by Application Gary DeRoest

  39. Disk Organized by Project Gary DeRoest

  40. XCOPY & MOVE • 2 important tools to organize disks • ATTRIB also helps in marking files to be copied and/or moved Gary DeRoest

  41. TREE A:\>tree /? Graphically displays the folder structure of a drive or path. TREE [drive:][path] [/F] [/A] /F Display the names of the files in each folder. /A Use ASCII instead of extended characters. Gary DeRoest

  42. TREE A:\>tree A:\ /f Folder PATH listing Volume serial number is 71FAE346 B421:254C A:. │ data │ ├───countries │ usa │ france │ brazil │ └───book The Fellowship of the Ring The Two Towers The Return of the King Gary DeRoest

  43. File Storage, Efficiency, and Errors • Lost clusters • Cross-Linked files • Fragmentation Gary DeRoest

  44. CHKDSK • Report disk space statistics • Repair lost cluster errors (/F) • Report on contiguousness of files • Display full path to all files on FAT (/V) • Locate bad sectors and recovers readable data (/R) Gary DeRoest

  45. CHKDSK • Volumes must be locked down before changes can be made • Often requires a system restart Gary DeRoest

  46. CHKDSK - FAT • Integrity and validity of directory table • directory structure • long file names • file dates • Trace files to verify space usage, file size • Correct discrepancies in FAT(1) and FAT(2) • Create report Gary DeRoest

  47. CHKDSK - NTFS • Stage 1 • verify each file in MFT and which clusters it utilizes • Sage 2 • file date/time • directory association verification • Stage 3 • security verification Gary DeRoest

  48. CHKDSK chkdsk a: The type of the file system is FAT. Volume Serial Number is AC13-7F6F Windows is verifying files and folders... File and folder verification is complete. Windows has checked the file system and found no problems. 1,457,664 bytes total disk space. 1,457,664 bytes available on disk. 512 bytes in each allocation unit. 2,847 total allocation units on disk. 2,847 allocation units available on disk. Gary DeRoest

  49. SCANDISK • Repair (delete) crossed-linked files • Poor reporting capabilities Gary DeRoest

  50. SCANDISK Gary DeRoest

More Related