What Windows commands will delete the files and directories at the destination location that no longer exist at the source location?
Show
Introduction to basic DOS command prompt use.
SummaryDOS (Disk Operating System) was the first widely-installed operating system for IBM-compatible personal computers. DOS is a non-graphical line-oriented command-driven computer operating system. It has a relatively simple--but not overly "friendly"--user interface. The earliest versions of the Microsoft Windows operating system were really just applications that ran on top of the MS-DOS operating system. Modern versions of Windows (Windows 95 and greater) no longer run on top of DOS, but do retain a DOS-like user interface called the "MS-DOS Prompt" or "Command Prompt". The command prompt allows Windows users to issue DOS commands to the system. DOS commands are useful to Windows users for a variety of reasons. Many tasks that can be performed in the Windows graphical environment can be performed much more quickly and efficiently by utilizing DOS commands. Also, most bootable floppy disks will boot the system directly to a DOS environment. DescriptionUsers of any Windows system can invoke a command prompt by performing the following steps:
A command prompt window is generally white or gray text on a black background. The prompt itself usually takes the following form: X:\PATH>where "X" represents the letter of the active drive, and "PATH" refers to the present working directory. Here's an example of how a DOS command prompt commonly looks: C:\Windows>_Commands are typed and echoed to the screen at the cursor's location. Usually commands consist of a keyword, followed by optional flags, followed by a path. More will be explained about syntax and additional flags under each specific command. Click on a command to receive more information about it. Important Information
Back to Menu of Commands DIRDisplays a list of files and subdirectories in a directory. SYNTAXDIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]] [/O[[:]sortorder]] [/S] [/B] [/L] [/V]
EXAMPLES
dir /s - Lists the files in the directory that you are in and all sub directories after that directory. dir /p - If the directory has a lot of files and you cannot read all the files you can use this command and it will display all files one page at a time. dir /w - Lists just the files and directories, going horizontal, and taking as little as space needed. dir /a:-s - This would list all the files that aren't system files in the current directory. Back to Menu of Commands CDChanges the current directory SYNTAX
CD[..]
cd .. - Goes up one directory. For example if you are within the C:\WINDOWS\COMMAND> directory this would take you to C:\WINDOWS> cd windows - Changes to the Windows subdirectory of the current directory (if it exists). Note: If you want to change to a different drive, CD will not switch to it. CD only changes directories in the current drive. To change drives, type the drive letter followed by a colon. i.e. cd d: will not switch to the d drive, but d: will switch drives. Back to Menu of Commands COPY
Copies one or more files to another location. COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination] [/A | /B]] [/V] [/Y | /-Y]
To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format). EXAMPLES
copy autoexec.bat c:\windows - Copies autoexec.bat from the current directory to the Windows directory of the C: drive. copy file1.txt+file2.txt+file3.txt newfile.txt /v - This would add together (concatenate) file1.txt, file2.txt and file3.txt and store the results in newfile.txt, then verify that it copied correctly. Back to Menu of Commands DELETEDeletes one or more files. SYNTAXDEL [drive:][path]filename [/P]
del c:\windows\test.tmp - Deletes test.tmp from the C:\Windows directory (if it exists). del c:\windows\temp\*.* /P - Deletes all files in the C:\Windows\temp directory, and requires confirmation for each file. Back to Menu of Commands XCOPY Xcopy is a powerful version of the copy command with additional features. It has the ability to move files, directories and even whole drives from one destination to another. It also can
preserve file attributes and long file names. XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/W] [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U] [/K] [/N]
xcopy c:\windows\desktop c:\desktop /a /e /f /h /k - Copies all files and folders in the C:\Windows\Desktop folder to the C:\Desktop folder. Back to Menu of Commands DELTREE Deletes a directory and all the subdirectories and files in it. DELTREE [/Y] [drive:]path [[drive:]path[...]]
Note: Use DELTREE cautiously. Every file and subdirectory within the specified directory will be deleted. Once deleted you cannot recover the information. EXAMPLES
Back to Menu of Commands MOVEMoves files and renames files and directories. To move one or more files: MOVE [/Y | /-Y] [drive:][path]filename1[,...]destination
move /Y c:\temp temp2 - Moves the C:\temp directory and all contents to the C:\temp2 directory and suppress confirmation. Back to Menu of Commands RENRenames a file/directory or files/directories. SYNTAX REN [drive:][path][directoryname1 | filename1] [directoryname2 | filename2]
ren *.txt *.bak - Rename all text files to files with .bak extension. ren * 1_* - Rename all files to begin with 1_. The asterisk (*) in this example is a wild character this means all files. Back to Menu of Commands MKDIRCreates a directory. SYNTAX
MD [drive:]path
Back to Menu of Commands RMDIRRemoves (deletes) a directory. SYNTAX
Back to Menu of Commands ATTRIB Displays or changes file attributes such as read only, hidden, system, and archive. Attrib is necessary to use most other commands that do not work when some of these attributes are set. ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:][path]filename] [/S]
attrib +r autoexec.bat - Makes the autoexec.bat so it cannot be modified until the read only attribute is taken off. attrib +h config.sys - Hides config.sys from a normal directory listing. However, hidden files are always visible to the attrib command. attrib -h config.sys - This command does the opposite of the above command. Instead of hiding the file it will unhide it if currently hidden. Back to Menu of Commands PINGPing is used to determine if a connection exists between your computer, and another computer connected via TCP/IP. It sends small packets of information to the other computer, which are returned if the connection is found, and lost otherwise. Ping is a powerful utility to help determine network related problems. SYNTAXping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] destination-list
C:\>ping localhost Pinging 127.0.0.1 with 32 bytes of data: Reply from 127.0.0.1: bytes=32 time<10ms TTL=128 Ping statistics for 127.0.0.1: ping xxx.xxx.xxx.xxx - Allows you to ping another computer where the x's are located are where you would place the IP address of the
computer you are attempting to ping. If this is not able to complete this should relay back an unsuccessful message (request timed out) which could be an indication of cable issues, network card issues, hub issue, etc. C:\>ping helpdesk.doit.wisc.edu Pinging helpdesk.doit.wisc.edu[144.92.9.69] with 32 bytes of data: Reply from 144.92.9.69: bytes=32 time=2ms TTL=254 Ping statistics for 144.92.9.69: Back to Menu of Commands TRACERTThe tracert command is very similar to ping, and is used to visually see a network packet being sent and received and the amount of hops required for that packet to get to its destination. It shows you exactly how far a packet can go before it fails. This will help you know if the connection problem is close, or more towards the destination. SYNTAXtracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
C:\>tracert helpdesk.doit.wisc.edu Tracing route to helpdesk.doit.wisc.edu [144.92.9.69] 1 <10 ms <10 ms <10 ms 144.92.124.1 Trace complete. Here is another tracert to Google.com, a much further destination. C:\>tracert www.google.com Tracing route to google.lb.google.com [216.239.37.100] 1 <10 ms <10 ms <10 ms 144.92.124.1 Trace complete. Back to Menu of Commands Which Windows file system is best to be placed on this drive if encryption will be used?Encryption: The NTFS 5.0 file system can automatically encrypt and decrypt file data as it is read and written to the disk.
What command can be used to scan for Windows installations not stored in the BCD?What command can be used to scan for Windows installations not stored in the BCD? The Advanced Boot Options menu appears when a user presses F8 as Windows is loading.
How often does Windows automatically defragment a hard drive or trim a solid state drive?Unfortunately, since the last optimization times are being forgotten, the Windows 10 automatic maintenance will cause an SSD drive to be defragged much more often than once a month if you commonly restart Windows. These automatic drive optimizations are schedule for once a week, but can be configured to be done daily.
What are reasons to uninstall software you no longer use?Uninstalling unused or unwanted programs can help your computer in various ways. By uninstalling these programs you will be, Adding hard drive space. Increasing computer speed – By removing programs you're not using, they won't have access to run in your background; therefore, increasing PC speeds.
|