This article was previously published under Q67941
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
This article explains how to use DEBUG to remove the hidden attribute fromfiles on your system.
The method described below uses DEBUG to create a small program thatremoves the hidden attribute from a file. This method should be used onlyas a last resort.
At the MS-DOS prompt, type the following commands:
DEBUG A 100 mov dx,116 mov ax,4300 int 21 and cx,fffd mov dx,116 mov ax,4301 int 21 int 20 <ENTER> E 116 'filename' 0 <------- replace "filename" with the path G and filename of the target file. Example: e 116 'C:\DATA\TEST.DAT' 0
When you type the command "G," DEBUG executes the section of code in memory. If you have typed everything correctly, the message "Program terminated normally" is displayed.
Type Q to quit DEBUG, then verify that the file is no longer hidden.
The following is a detailed description of the preceding code:
mov dx,116 ; load the offset to filename into dxmov ax,4300 ; load get/set file attributes function number into ax int 21 ; call DOS interrupt 21H to read attribute information and cx,fffd ; strip off only hidden attribute bitmov dx,116 ; load the offset to filename into dxmov ax,4301 ; load get/set file attributes function number into ax int 21 ; call DOS interrupt 21H to write attribute informationint 20 ; terminate program
The program begins by calling Int 21H function 43H to get the current fileattribute. The attribute byte is returned in register CX, which is thenANDed with hex FFFD to reset bit 1. The program calls the get/set fileattribute function again to write the attribute in register CX to the file.