KB: SCCM error: “The directory is not empty”

Problem case:

The deployment is stalling at the step “Wiping volume c”.

As seen below, smsts.log states that it fails to complete installation of the image, with the error: “The directory is not empty”.

Investigating the files on the local drive gave me a clue that some files could not be deleted. The folder “Documents and Settings” was still visible on the local drive C, and a single file in the users documents called “SlideIT.exe “ was not deleted during “Wiping volume c”.

Notice the whitespace in the end of “SlideIT.exe “.

As the deployment was a migration scenario using Hardlink, the drive is wiped (files deleted) and the disk not formatted completely.

If a single file is named with whitespace in the end, a normal delete command cannot delete the file or could be the fact that the process “Wiping volume c” was active and locked the file.

Solution:

  1. Locate the undeleted files on the local drive while error message is still present
  2. Reboot using a SCCM bootdisk to enter WinPE
  3. Quickly delete the issued files before the error state occurs and the file(s) enter “in use state” using the following commands:
    1. Del /s [directory] – Deletes  folders and subfolders
    2. Rmdir /s [directory] if needed – Deletes an empty folder
    3. Restart deployment
This entry was posted in SCCM. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s