Edit

Share via


Repair or replace corrupted or missing binary files in an Azure VM running Windows

Applies to: ✔️ Windows VMs

This article shows how to repair or replace corrupted or missing system binary files in an Azure virtual machine (VM) running Windows.

How to repair or replace corrupted or missing binary files

Repair or replace the corrupted or missing binary (.sys) file by following these steps:

Repair the corrupt binary file

Open an elevated CMD prompt and run chkdsk on the disk:

chkdsk <drive-letter>: /F

Replace the corrupt binary file

  1. On the attached disk, browse to the location of the binary file that's displayed in the error message.

  2. Rename the file from <binary-name>.sys to <binary-name>.sys.old.

  3. On the attached disk, browse to the \Windows\WinSxS folder. Then, search for the binary file that's displayed in the error message. To do this, run the following command at a command prompt:

    dir <binary-name> /s
    

    The command lists all the different versions of the binary file together with the created date. Copy the latest version of the binary file to the \Windows\System32\Drivers folder by running the following command:

    copy <drive>:\Windows\WinSxS\<directory-where-file-is>\<binary-name>.sys <drive>:\Windows\System32\Drivers\
    

    For example, see the following console output:

    E:\Windows\WinSxS>dir ACPI.sys /s 
     Volume in drive E has no label. 
     Volume Serial Number is A0B1-C2D3 
    
     Directory of E:\Windows\WinSxS\amd64_acpi.inf_0123456789abcdef_6.3.9600.16384_none_cdef0123456789ab 
    
    11/21/2014  07:48 PM            94,989 acpi.sys 
                   1 File(s)         94,989 bytes 
    
     Directory of E:\Windows\WinSxS\amd64_acpi.inf_0123456789abcdef_6.3.9600.16384_none_89abcdef01234567 
    
    11/21/2014  07:48 PM           119,547 acpi.sys 
                   1 File(s)        119,547 bytes 
    
     Directory of E:\Windows\WinSxS\amd64_acpi.inf_0123456789abcdef_6.3.9600.16384_none_456789abcdef0123 
    
    11/21/2014  04:06 PM           533,824 acpi.sys 
                   1 File(s)        533,824 bytes 
    
         Total Files Listed: 
                   3 File(s)        748,360 bytes 
                   0 Dir(s)  123,967,512,576 bytes free 
    
    E:\Windows\WinSxS>copy E:\Windows\WinSxS\amd64_acpi.inf_0123456789abcdef_6.3.9600.16384_none_cdef0123456789ab\acpi.sys E:\Windows\System32\Drivers\ 
            1 file(s) copied. 
    
    E:\Windows\WinSxS> 
    

    Note

    • If the system binary file can't be renamed, take ownership of the file. This action gives you full access to this file.

    • The example console output shows volume E as an example. The actual letter should reflect the faulty drive (the OS disk attached as a data disk on the troubleshooting VM).

    • If the latest binary doesn't work, you can try the previous file version to obtain an earlier system update level on that component.

    • If the only binary that's returned in this step matches the file that you're trying to replace on the affected VM, and if both files have the same size and time stamp, you can replace the corrupted file by copying it from another working VM that has the same OS and, if possible, the same system update level.

  4. Detach the repaired disk from the troubleshooting VM. Then, create a VM from the OS disk.

Contact us for help

If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.