Debug: W (Write)
Page updated January 21, 2005
Syntax
w [Address] [Drive] [FirstSector] [Number]
Parameters
Remarks
- Windows XP and the Windows Server 2003 family of products do not use this command. It is included only to preserve compatibility with existing MS-DOS files, but it has no effect at the command line because the functionality is automatic.
- To write the contents of the number of bytes specified 
					in the BX:CX registers to a disk file, use the following 
					syntax:
					w [Address] 
- To bypass the file system and directly write to specific 
					sectors, use the following syntax:
					w [Address] [Drive] [FirstSector] [Number] 
- 
					Specifying valid Address entriesAddress is a two-part designation, containing either an alphabetic segment register or a four-digit segment address with an offset value. You can omit the segment register or segment address. CS is the default segment for the following debug subcommands: a, g, l, t, u, and w. DS is the default segment for all other subcommands. All numeric values are in hexadecimal format. You must include a colon between the segment name and the offset value. The following are valid addresses: CS:0100 04BA:0100 
- Specifying the name of the disk file You must specify the name of the disk file either when you start Debug.exe or in the most recent n (name) subcommand. Both of these methods properly format a file name for a file control block at address CS:5C.
- 
					Resetting BX:CX before using w without parametersIf you use the g (go), t (trace), p (proceed), or r (register) subcommands, you must reset the BX:CX registers before using the w subcommand without parameters. 
- Writing a modified file to a disk
					If you modify the file but do not change the name, length, or starting address, Debug.exe can write the file to the original disk location correctly. 
- Writing .exe or .hex files
					You cannot write an .exe or .hex file with this command. Important - Writing to specific sectors is extremely risky because it bypasses the Windows XP file handler. The disk's file structure can be damaged if you type the wrong values.
 
- For information about specifying a file by using the n (name) subcommand, see Related Topics.
- For information about loading the contents of a file or file sectors into memory by using the l (load) subcommand, see Related Topics
Examples
wcs:100 1 37 2b
When the write operation is complete, Debug.exe displays the debug prompt again.
Formatting legend
| Format | Meaning | 
| Italic | Information that the user must supply | 
| Bold | Elements that the user must type exactly as shown | 
| Ellipsis (...) | Parameter that can be repeated several times in a command line | 
| Between brackets ([]) | Optional items | 
| Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one | 
| Courier font | Code or program output | 
Some of these terms may be the same or similar to DOS commands. For information on DOS Commands, click here
