How to invoke the DISKPART.EXE/S command from MDT

zero kill 0 Reputation points
2024-01-24T07:12:45.09+00:00

I want to convert the hard disk from MBR to GPT with the DISKPART command before deploying the system using MDT But running the command line in the task sequence will return code "-2147467259 0x80004005" User's image

The "1.txt" file has been copied to the PE system

Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-01-26T07:13:49.8233333+00:00

    Hello, The error code you are getting is a generic “Unspecified error” message from DISM. It is usually associated with task sequence failures, specifically when the task sequence environment is not properly initialized. If you want to convert the hard disk from MBR to GPT using the DISKPART command, you need to make sure that your task sequence environment is properly initialized. Here’s an example of how you can do this: First, add a “Restart in Windows PE” task to your task sequence. This will ensure that your task sequence environment is properly initialized. After the restart, add a “Run Command Line” task to run the DISKPART commands. In the command line, type: cmd /c "echo select disk 0 > diskpart.txt && echo clean >> diskpart.txt && echo convert gpt >> diskpart.txt && diskpart /s diskpart.txt" This command will select the first hard disk (disk 0), clean it (delete all partitions), and then convert it to GPT. After the conversion, you can proceed with your usual tasks (e.g., applying the image, installing software, etc.). Also, note that the “clean” command will delete all data on the disk, so make sure you have a backup if necessary. Best Regards,
    Hania Lian If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.