Windows 8 Deployment – The specified path, file name, or both are too long

If you started to do deployment with Windows 8 and MDT 2012 Update 1 you are likely to have seen the following error:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

In MDT 2012 Update 1 it will look like this:  

The root cause goes back to limitations in the Windows file I/O APIs, but it got worse because of the not-that-bright person(s) in the Windows team who decided files and folder names on the Windows 8 installation media… The longest path on the Window 8 media is 168 characters which leave only 79 characters for the MDT deployment share(s).

The longest path can easily be tested via PowerShell (Thanks David Eggins @ www.eggins.com for posting this sample). The command is:

$len=0;dir -r|%{if ($_.FullName.Length -gt $len) {$len=$_.FullName.Length} };$len

Update 2015-03-21: An updated script sample from ChadsTech (thanks), also reveals the offending, i.e. longest named, file. That command is:

$len=0;dir -r|%{if ($_.FullName.Length -gt $len) {$len=$_.FullName.Length; $LongFile=$_.FullName} };$len;$LongFile

What's in it for me?

Well, if you create a deployment share in the "D:\MDTproduction" folder, and when importing the Windows 8 operating system select to create the "Windows 8 Enterprise X64 RTM Default Image" folder, the result below will have a total path length of 243 characters which is OK.

OK (243 characters in total)

D:\MDTProduction\Operating Systems\Windows 8 Enterprise X64 RTM Default Image

However if you create an offline media of the above deployment share, MDT will add a few new folders, and if you put the media in D:\MDTMedia001 the result is a total path length of 256 characters which is not OK.

Not OK (256 characters in total)

D:\MDTMedia001\Content\Deploy\Operating Systems\Windows 8 Enterprise X64 RTM Default Image

Solution

Use slightly shorter destination directory name when importing the Windows 8 operating system, like "Windows 8 Enterprise X64 RTM"

OK (229 characters in total)

D:\MDTProduction\Operating Systems\Windows 8 Enterprise X64 RTM

Offline media version:

OK (242 characters in total)

D:\MDTMedia001\Content\Deploy\Operating Systems\Windows 8 Enterprise X64 RTM

/ Johan

About the author

Johan Arwidmark

0 0 votes
Article Rating
Subscribe
Notify of
guest
3 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
unrestben
unrestben
1 year ago

Thank you! This was driving me nuts after importing a new ProDesk 600 G6 driver pack.

ChadsTech
ChadsTech
8 years ago

Here's a modified PowerShell sample that will also show the offending, i.e. longest named, file to help track down the culprit.

$len=0;dir -r|%{if ($_.FullName.Length -gt $len) {$len=$_.FullName.Length; $LongFile=$_.FullName}};$len;$LongFile

ricktor
ricktor
10 years ago

thanks for the info.,you could also try long path tool. it helped me with error 1320 in Win 7.,:)


>