CreateDirectoryW fails

Hi

I want to create a directory with more then 300 characters. I am using
the CreateDirectoryW function and prepending \\?\ to the path
for eg..    
  CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
 but the function fails with error 123.

What could be the problem. I am working on Windows 2000.

Regards
Jakir
0
jakir (33)
7/23/2004 6:00:04 PM
vc.mfc 33608 articles. 0 followers. Follow

12 Replies
1400 Views

Similar Articles

[PageSpeed] 22

Would it hurt to tell us what error 123 means? 

(I looked it up and it says the fllename syntax is illegal).

Give your code snippet below, I'm not surprised. Take a look at CreateDirectoryW. What is
its argument type? A Unicode string. So you should supply a Unicode string as the
argument, e.g.,

CreateDirectoryW( L"\\\\?\\C:\\Temp||unbelievablylongnamehere" );

This means that you cannot use CString arguments unless you are either using VC7.0 (where
you can have a mix of 8-bit and Unicode CStrings) or your entire app is Unicode, or you
convert the 8-bit string to Unicode so you can use it as an argument.
				joe

On 23 Jul 2004 11:00:04 -0700, jakir@coolgoose.com (Jakir) wrote:

>Hi
>
>I want to create a directory with more then 300 characters. I am using
>the CreateDirectoryW function and prepending \\?\ to the path
>for eg..    
>  CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
> but the function fails with error 123.
>
>What could be the problem. I am working on Windows 2000.
>
>Regards
>Jakir

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
7/23/2004 9:18:25 PM
If you also try to create a directory in Explorer of 300 character it truncates
the directory...is this limitation of Windows....


Regards
Jakir


jakir@coolgoose.com (Jakir) wrote in message news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
> Hi
> 
> I want to create a directory with more then 300 characters. I am using
> the CreateDirectoryW function and prepending \\?\ to the path
> for eg..    
>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
>  but the function fails with error 123.
> 
> What could be the problem. I am working on Windows 2000.
> 
> Regards
> Jakir
0
jakir (33)
7/23/2004 10:45:18 PM
It may be a limitation of Explorer...
			joe

On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:

>If you also try to create a directory in Explorer of 300 character it truncates
>the directory...is this limitation of Windows....
>
>
>Regards
>Jakir
>
>
>jakir@coolgoose.com (Jakir) wrote in message news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
>> Hi
>> 
>> I want to create a directory with more then 300 characters. I am using
>> the CreateDirectoryW function and prepending \\?\ to the path
>> for eg..    
>>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
>>  but the function fails with error 123.
>> 
>> What could be the problem. I am working on Windows 2000.
>> 
>> Regards
>> Jakir

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
7/24/2004 1:43:11 AM
Hi Joe,

Please  see the sample application which I was trying....


#include <Windows.h>

int main(int argc, char* argv[])
{
	
	char DirName[1024] = {0};
	wchar_t wDirName[1024] = {0};
	char Temp[1024] = {0};

	fgets(Temp, 1023, stdin); // Could be any long name

	strcpy(DirName, "\\\\?\\C:\\TempCM\\");
	Temp[strlen(Temp)-1] = '\0';
	strcat(DirName, Temp);

	printf("The Length is %d. \n", strlen(DirName));
	MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName), wDirName, 1023);

	if(CreateDirectoryW(wDirName, NULL) == 0)
	{
		printf("%d \n", GetLastError());
	}

	return 0;
}


Regards
Jakir
Joseph M. Newcomer <newcomer@flounder.com> wrote in message news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
> It may be a limitation of Explorer...
> 			joe
> 
> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:
> 
> >If you also try to create a directory in Explorer of 300 character it truncates
> >the directory...is this limitation of Windows....
> >
> >
> >Regards
> >Jakir
> >
> >
> >jakir@coolgoose.com (Jakir) wrote in message news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
> >> Hi
> >> 
> >> I want to create a directory with more then 300 characters. I am using
> >> the CreateDirectoryW function and prepending \\?\ to the path
> >> for eg..    
> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
> >>  but the function fails with error 123.
> >> 
> >> What could be the problem. I am working on Windows 2000.
> >> 
> >> Regards
> >> Jakir
> 
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
0
jakir (33)
7/26/2004 3:30:03 PM
That looks like the sort of code I would have written to do the test. The only problem
here is that you did not actually print out the string you are using, so you are merely
hoping that it is actually correct. I see nothing here that looks wrong, but you didn't
say what sort of string you typed in. Note that I think there is a limitation on the
length that any one component of a path can be, e.g., 256 bytes, but with the \\?\ escape
you can have a path of up to 32K characters. But it would be of the form
....256chars...\....256 chars...\...256 chars...  etc. I'm not sure why this factoid sticks
in my mind, but it is something you might want to check out. I believe that limitation is
imposed by Windows, but a quick search didn't turn up anything.
					joe

On 26 Jul 2004 08:30:03 -0700, jakir@coolgoose.com (Jakir) wrote:

>Hi Joe,
>
>Please  see the sample application which I was trying....
>
>
>#include <Windows.h>
>
>int main(int argc, char* argv[])
>{
>	
>	char DirName[1024] = {0};
>	wchar_t wDirName[1024] = {0};
>	char Temp[1024] = {0};
>
>	fgets(Temp, 1023, stdin); // Could be any long name
>
>	strcpy(DirName, "\\\\?\\C:\\TempCM\\");
>	Temp[strlen(Temp)-1] = '\0';
>	strcat(DirName, Temp);
>
>	printf("The Length is %d. \n", strlen(DirName));
>	MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName), wDirName, 1023);
>
>	if(CreateDirectoryW(wDirName, NULL) == 0)
>	{
>		printf("%d \n", GetLastError());
>	}
>
>	return 0;
>}
>
>
>Regards
>Jakir
>Joseph M. Newcomer <newcomer@flounder.com> wrote in message news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
>> It may be a limitation of Explorer...
>> 			joe
>> 
>> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:
>> 
>> >If you also try to create a directory in Explorer of 300 character it truncates
>> >the directory...is this limitation of Windows....
>> >
>> >
>> >Regards
>> >Jakir
>> >
>> >
>> >jakir@coolgoose.com (Jakir) wrote in message news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
>> >> Hi
>> >> 
>> >> I want to create a directory with more then 300 characters. I am using
>> >> the CreateDirectoryW function and prepending \\?\ to the path
>> >> for eg..    
>> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
>> >>  but the function fails with error 123.
>> >> 
>> >> What could be the problem. I am working on Windows 2000.
>> >> 
>> >> Regards
>> >> Jakir
>> 
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
7/27/2004 2:52:48 PM
Thanks Joe.

For eg. the input contains 300 characters of 'a'. 

I too thought that the path limit of 32K characters would be of sort
256chars..\256chars... and so on. So I created a directory
"aaaaaaaa...(200 characters))" and programatically set my current
directory using SetCurrentDirectory to that and then tried to create a
directory of 200 characters say "bbbb...(200 Characters) but it to
fails.

Windows Explorer to doesnot allow you to create a path of more then
256 characters.
Is there any way to overcome this problem.

Regards
Jakir

Joseph M. Newcomer <newcomer@flounder.com> wrote in message news:<ilqcg0d093o3id1u1qpgngeqlmrp0js9d1@4ax.com>...
> That looks like the sort of code I would have written to do the test. The only problem
> here is that you did not actually print out the string you are using, so you are merely
> hoping that it is actually correct. I see nothing here that looks wrong, but you didn't
> say what sort of string you typed in. Note that I think there is a limitation on the
> length that any one component of a path can be, e.g., 256 bytes, but with the \\?\ escape
> you can have a path of up to 32K characters. But it would be of the form
> ...256chars...\....256 chars...\...256 chars...  etc. I'm not sure why this factoid sticks
> in my mind, but it is something you might want to check out. I believe that limitation is
> imposed by Windows, but a quick search didn't turn up anything.
> 					joe
> 
> On 26 Jul 2004 08:30:03 -0700, jakir@coolgoose.com (Jakir) wrote:
> 
> >Hi Joe,
> >
> >Please  see the sample application which I was trying....
> >
> >
> >#include <Windows.h>
> >
> >int main(int argc, char* argv[])
> >{
> >	
> >	char DirName[1024] = {0};
> >	wchar_t wDirName[1024] = {0};
> >	char Temp[1024] = {0};
> >
> >	fgets(Temp, 1023, stdin); // Could be any long name
> >
> >	strcpy(DirName, "\\\\?\\C:\\TempCM\\");
> >	Temp[strlen(Temp)-1] = '\0';
> >	strcat(DirName, Temp);
> >
> >	printf("The Length is %d. \n", strlen(DirName));
> >	MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName), wDirName, 1023);
> >
> >	if(CreateDirectoryW(wDirName, NULL) == 0)
> >	{
> >		printf("%d \n", GetLastError());
> >	}
> >
> >	return 0;
> >}
> >
> >
> >Regards
> >Jakir
> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
> >> It may be a limitation of Explorer...
> >> 			joe
> >> 
> >> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:
> >> 
> >> >If you also try to create a directory in Explorer of 300 character it truncates
> >> >the directory...is this limitation of Windows....
> >> >
> >> >
> >> >Regards
> >> >Jakir
> >> >
> >> >
> >> >jakir@coolgoose.com (Jakir) wrote in message news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
> >> >> Hi
> >> >> 
> >> >> I want to create a directory with more then 300 characters. I am using
> >> >> the CreateDirectoryW function and prepending \\?\ to the path
> >> >> for eg..    
> >> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
> >> >>  but the function fails with error 123.
> >> >> 
> >> >> What could be the problem. I am working on Windows 2000.
> >> >> 
> >> >> Regards
> >> >> Jakir
> >> 
> >> Joseph M. Newcomer [MVP]
> >> email: newcomer@flounder.com
> >> Web: http://www.flounder.com
> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> 
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
0
jakir (33)
7/28/2004 6:02:56 PM
Hmmm. I've not played in this area, so I was relying on the documentation, which states
that long paths are possible. One thing I'd try, however, is to give the name

\\?\ccccccccccccccccc...cccccccccc

as the name, rather than just

ccccccccccccccccccccccccc

It may be that you need to escape the name at each level. 
					joe

On 28 Jul 2004 11:02:56 -0700, jakir@coolgoose.com (Jakir) wrote:

>Thanks Joe.
>
>For eg. the input contains 300 characters of 'a'. 
>
>I too thought that the path limit of 32K characters would be of sort
>256chars..\256chars... and so on. So I created a directory
>"aaaaaaaa...(200 characters))" and programatically set my current
>directory using SetCurrentDirectory to that and then tried to create a
>directory of 200 characters say "bbbb...(200 Characters) but it to
>fails.
>
>Windows Explorer to doesnot allow you to create a path of more then
>256 characters.
>Is there any way to overcome this problem.
>
>Regards
>Jakir
>
>Joseph M. Newcomer <newcomer@flounder.com> wrote in message news:<ilqcg0d093o3id1u1qpgngeqlmrp0js9d1@4ax.com>...
>> That looks like the sort of code I would have written to do the test. The only problem
>> here is that you did not actually print out the string you are using, so you are merely
>> hoping that it is actually correct. I see nothing here that looks wrong, but you didn't
>> say what sort of string you typed in. Note that I think there is a limitation on the
>> length that any one component of a path can be, e.g., 256 bytes, but with the \\?\ escape
>> you can have a path of up to 32K characters. But it would be of the form
>> ...256chars...\....256 chars...\...256 chars...  etc. I'm not sure why this factoid sticks
>> in my mind, but it is something you might want to check out. I believe that limitation is
>> imposed by Windows, but a quick search didn't turn up anything.
>> 					joe
>> 
>> On 26 Jul 2004 08:30:03 -0700, jakir@coolgoose.com (Jakir) wrote:
>> 
>> >Hi Joe,
>> >
>> >Please  see the sample application which I was trying....
>> >
>> >
>> >#include <Windows.h>
>> >
>> >int main(int argc, char* argv[])
>> >{
>> >	
>> >	char DirName[1024] = {0};
>> >	wchar_t wDirName[1024] = {0};
>> >	char Temp[1024] = {0};
>> >
>> >	fgets(Temp, 1023, stdin); // Could be any long name
>> >
>> >	strcpy(DirName, "\\\\?\\C:\\TempCM\\");
>> >	Temp[strlen(Temp)-1] = '\0';
>> >	strcat(DirName, Temp);
>> >
>> >	printf("The Length is %d. \n", strlen(DirName));
>> >	MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName), wDirName, 1023);
>> >
>> >	if(CreateDirectoryW(wDirName, NULL) == 0)
>> >	{
>> >		printf("%d \n", GetLastError());
>> >	}
>> >
>> >	return 0;
>> >}
>> >
>> >
>> >Regards
>> >Jakir
>> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
>> >> It may be a limitation of Explorer...
>> >> 			joe
>> >> 
>> >> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:
>> >> 
>> >> >If you also try to create a directory in Explorer of 300 character it truncates
>> >> >the directory...is this limitation of Windows....
>> >> >
>> >> >
>> >> >Regards
>> >> >Jakir
>> >> >
>> >> >
>> >> >jakir@coolgoose.com (Jakir) wrote in message news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
>> >> >> Hi
>> >> >> 
>> >> >> I want to create a directory with more then 300 characters. I am using
>> >> >> the CreateDirectoryW function and prepending \\?\ to the path
>> >> >> for eg..    
>> >> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
>> >> >>  but the function fails with error 123.
>> >> >> 
>> >> >> What could be the problem. I am working on Windows 2000.
>> >> >> 
>> >> >> Regards
>> >> >> Jakir
>> >> 
>> >> Joseph M. Newcomer [MVP]
>> >> email: newcomer@flounder.com
>> >> Web: http://www.flounder.com
>> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
>> 
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
7/28/2004 7:57:32 PM
Call GetVolumeInformation and check MaxComponentLength. I suspect it is 256
or 255 for NTFS (it is 255 for VFAT). While \\?\ prefix allows to overcome
total path length limit, you cannot work around MaxComponentLength.

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:i61gg09qhfre1qd7b26vp19b327kgt04li@4ax.com...
> Hmmm. I've not played in this area, so I was relying on the documentation,
which states
> that long paths are possible. One thing I'd try, however, is to give the
name
>
> \\?\ccccccccccccccccc...cccccccccc
>
> as the name, rather than just
>
> ccccccccccccccccccccccccc
>
> It may be that you need to escape the name at each level.
> joe
>
> On 28 Jul 2004 11:02:56 -0700, jakir@coolgoose.com (Jakir) wrote:
>
> >Thanks Joe.
> >
> >For eg. the input contains 300 characters of 'a'.
> >
> >I too thought that the path limit of 32K characters would be of sort
> >256chars..\256chars... and so on. So I created a directory
> >"aaaaaaaa...(200 characters))" and programatically set my current
> >directory using SetCurrentDirectory to that and then tried to create a
> >directory of 200 characters say "bbbb...(200 Characters) but it to
> >fails.
> >
> >Windows Explorer to doesnot allow you to create a path of more then
> >256 characters.
> >Is there any way to overcome this problem.
> >
> >Regards
> >Jakir
> >
> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
news:<ilqcg0d093o3id1u1qpgngeqlmrp0js9d1@4ax.com>...
> >> That looks like the sort of code I would have written to do the test.
The only problem
> >> here is that you did not actually print out the string you are using,
so you are merely
> >> hoping that it is actually correct. I see nothing here that looks
wrong, but you didn't
> >> say what sort of string you typed in. Note that I think there is a
limitation on the
> >> length that any one component of a path can be, e.g., 256 bytes, but
with the \\?\ escape
> >> you can have a path of up to 32K characters. But it would be of the
form
> >> ...256chars...\....256 chars...\...256 chars...  etc. I'm not sure why
this factoid sticks
> >> in my mind, but it is something you might want to check out. I believe
that limitation is
> >> imposed by Windows, but a quick search didn't turn up anything.
> >> joe
> >>
> >> On 26 Jul 2004 08:30:03 -0700, jakir@coolgoose.com (Jakir) wrote:
> >>
> >> >Hi Joe,
> >> >
> >> >Please  see the sample application which I was trying....
> >> >
> >> >
> >> >#include <Windows.h>
> >> >
> >> >int main(int argc, char* argv[])
> >> >{
> >> >
> >> > char DirName[1024] = {0};
> >> > wchar_t wDirName[1024] = {0};
> >> > char Temp[1024] = {0};
> >> >
> >> > fgets(Temp, 1023, stdin); // Could be any long name
> >> >
> >> > strcpy(DirName, "\\\\?\\C:\\TempCM\\");
> >> > Temp[strlen(Temp)-1] = '\0';
> >> > strcat(DirName, Temp);
> >> >
> >> > printf("The Length is %d. \n", strlen(DirName));
> >> > MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName), wDirName,
1023);
> >> >
> >> > if(CreateDirectoryW(wDirName, NULL) == 0)
> >> > {
> >> > printf("%d \n", GetLastError());
> >> > }
> >> >
> >> > return 0;
> >> >}
> >> >
> >> >
> >> >Regards
> >> >Jakir
> >> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
> >> >> It may be a limitation of Explorer...
> >> >> joe
> >> >>
> >> >> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:
> >> >>
> >> >> >If you also try to create a directory in Explorer of 300 character
it truncates
> >> >> >the directory...is this limitation of Windows....
> >> >> >
> >> >> >
> >> >> >Regards
> >> >> >Jakir
> >> >> >
> >> >> >
> >> >> >jakir@coolgoose.com (Jakir) wrote in message
news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
> >> >> >> Hi
> >> >> >>
> >> >> >> I want to create a directory with more then 300 characters. I am
using
> >> >> >> the CreateDirectoryW function and prepending \\?\ to the path
> >> >> >> for eg..
> >> >> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
> >> >> >>  but the function fails with error 123.
> >> >> >>
> >> >> >> What could be the problem. I am working on Windows 2000.
> >> >> >>
> >> >> >> Regards
> >> >> >> Jakir
> >> >>
> >> >> Joseph M. Newcomer [MVP]
> >> >> email: newcomer@flounder.com
> >> >> Web: http://www.flounder.com
> >> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> >>
> >> Joseph M. Newcomer [MVP]
> >> email: newcomer@flounder.com
> >> Web: http://www.flounder.com
> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
alegr (1131)
7/29/2004 2:49:11 AM
That's sort of what I suspected. The fact that with a component length of, say, 200, he
seems unable to create, say, three 200-long components seemed odd, which is why I
suggested the experiment of escaping the component as he creates each level. Not sure why
this should make a difference, but who knows? 

Thanks for pointing out the API call; I don't play in this area so I wasn't aware of it.
				joe

On Wed, 28 Jul 2004 19:49:11 -0700, "Alexander Grigoriev" <alegr@earthlink.net> wrote:

>Call GetVolumeInformation and check MaxComponentLength. I suspect it is 256
>or 255 for NTFS (it is 255 for VFAT). While \\?\ prefix allows to overcome
>total path length limit, you cannot work around MaxComponentLength.
>
>"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
>news:i61gg09qhfre1qd7b26vp19b327kgt04li@4ax.com...
>> Hmmm. I've not played in this area, so I was relying on the documentation,
>which states
>> that long paths are possible. One thing I'd try, however, is to give the
>name
>>
>> \\?\ccccccccccccccccc...cccccccccc
>>
>> as the name, rather than just
>>
>> ccccccccccccccccccccccccc
>>
>> It may be that you need to escape the name at each level.
>> joe
>>
>> On 28 Jul 2004 11:02:56 -0700, jakir@coolgoose.com (Jakir) wrote:
>>
>> >Thanks Joe.
>> >
>> >For eg. the input contains 300 characters of 'a'.
>> >
>> >I too thought that the path limit of 32K characters would be of sort
>> >256chars..\256chars... and so on. So I created a directory
>> >"aaaaaaaa...(200 characters))" and programatically set my current
>> >directory using SetCurrentDirectory to that and then tried to create a
>> >directory of 200 characters say "bbbb...(200 Characters) but it to
>> >fails.
>> >
>> >Windows Explorer to doesnot allow you to create a path of more then
>> >256 characters.
>> >Is there any way to overcome this problem.
>> >
>> >Regards
>> >Jakir
>> >
>> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
>news:<ilqcg0d093o3id1u1qpgngeqlmrp0js9d1@4ax.com>...
>> >> That looks like the sort of code I would have written to do the test.
>The only problem
>> >> here is that you did not actually print out the string you are using,
>so you are merely
>> >> hoping that it is actually correct. I see nothing here that looks
>wrong, but you didn't
>> >> say what sort of string you typed in. Note that I think there is a
>limitation on the
>> >> length that any one component of a path can be, e.g., 256 bytes, but
>with the \\?\ escape
>> >> you can have a path of up to 32K characters. But it would be of the
>form
>> >> ...256chars...\....256 chars...\...256 chars...  etc. I'm not sure why
>this factoid sticks
>> >> in my mind, but it is something you might want to check out. I believe
>that limitation is
>> >> imposed by Windows, but a quick search didn't turn up anything.
>> >> joe
>> >>
>> >> On 26 Jul 2004 08:30:03 -0700, jakir@coolgoose.com (Jakir) wrote:
>> >>
>> >> >Hi Joe,
>> >> >
>> >> >Please  see the sample application which I was trying....
>> >> >
>> >> >
>> >> >#include <Windows.h>
>> >> >
>> >> >int main(int argc, char* argv[])
>> >> >{
>> >> >
>> >> > char DirName[1024] = {0};
>> >> > wchar_t wDirName[1024] = {0};
>> >> > char Temp[1024] = {0};
>> >> >
>> >> > fgets(Temp, 1023, stdin); // Could be any long name
>> >> >
>> >> > strcpy(DirName, "\\\\?\\C:\\TempCM\\");
>> >> > Temp[strlen(Temp)-1] = '\0';
>> >> > strcat(DirName, Temp);
>> >> >
>> >> > printf("The Length is %d. \n", strlen(DirName));
>> >> > MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName), wDirName,
>1023);
>> >> >
>> >> > if(CreateDirectoryW(wDirName, NULL) == 0)
>> >> > {
>> >> > printf("%d \n", GetLastError());
>> >> > }
>> >> >
>> >> > return 0;
>> >> >}
>> >> >
>> >> >
>> >> >Regards
>> >> >Jakir
>> >> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
>news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
>> >> >> It may be a limitation of Explorer...
>> >> >> joe
>> >> >>
>> >> >> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:
>> >> >>
>> >> >> >If you also try to create a directory in Explorer of 300 character
>it truncates
>> >> >> >the directory...is this limitation of Windows....
>> >> >> >
>> >> >> >
>> >> >> >Regards
>> >> >> >Jakir
>> >> >> >
>> >> >> >
>> >> >> >jakir@coolgoose.com (Jakir) wrote in message
>news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
>> >> >> >> Hi
>> >> >> >>
>> >> >> >> I want to create a directory with more then 300 characters. I am
>using
>> >> >> >> the CreateDirectoryW function and prepending \\?\ to the path
>> >> >> >> for eg..
>> >> >> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
>> >> >> >>  but the function fails with error 123.
>> >> >> >>
>> >> >> >> What could be the problem. I am working on Windows 2000.
>> >> >> >>
>> >> >> >> Regards
>> >> >> >> Jakir
>> >> >>
>> >> >> Joseph M. Newcomer [MVP]
>> >> >> email: newcomer@flounder.com
>> >> >> Web: http://www.flounder.com
>> >> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
>> >>
>> >> Joseph M. Newcomer [MVP]
>> >> email: newcomer@flounder.com
>> >> Web: http://www.flounder.com
>> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
>>
>> Joseph M. Newcomer [MVP]
>> email: newcomer@flounder.com
>> Web: http://www.flounder.com
>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
7/29/2004 7:00:41 AM
A path component is whatever between backslashes, not between dots. It's
each directory or file name.
With \\?\ prefix, there is also no current directory concept.

"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:518hg0h5ht95vpollcjm3gc0boc841ista@4ax.com...
> That's sort of what I suspected. The fact that with a component length of,
say, 200, he
> seems unable to create, say, three 200-long components seemed odd, which
is why I
> suggested the experiment of escaping the component as he creates each
level. Not sure why
> this should make a difference, but who knows?
>
> Thanks for pointing out the API call; I don't play in this area so I
wasn't aware of it.
> joe
>
> On Wed, 28 Jul 2004 19:49:11 -0700, "Alexander Grigoriev"
<alegr@earthlink.net> wrote:
>
> >Call GetVolumeInformation and check MaxComponentLength. I suspect it is
256
> >or 255 for NTFS (it is 255 for VFAT). While \\?\ prefix allows to
overcome
> >total path length limit, you cannot work around MaxComponentLength.
> >
> >"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
> >news:i61gg09qhfre1qd7b26vp19b327kgt04li@4ax.com...
> >> Hmmm. I've not played in this area, so I was relying on the
documentation,
> >which states
> >> that long paths are possible. One thing I'd try, however, is to give
the
> >name
> >>
> >> \\?\ccccccccccccccccc...cccccccccc
> >>
> >> as the name, rather than just
> >>
> >> ccccccccccccccccccccccccc
> >>
> >> It may be that you need to escape the name at each level.
> >> joe
> >>
> >> On 28 Jul 2004 11:02:56 -0700, jakir@coolgoose.com (Jakir) wrote:
> >>
> >> >Thanks Joe.
> >> >
> >> >For eg. the input contains 300 characters of 'a'.
> >> >
> >> >I too thought that the path limit of 32K characters would be of sort
> >> >256chars..\256chars... and so on. So I created a directory
> >> >"aaaaaaaa...(200 characters))" and programatically set my current
> >> >directory using SetCurrentDirectory to that and then tried to create a
> >> >directory of 200 characters say "bbbb...(200 Characters) but it to
> >> >fails.
> >> >
> >> >Windows Explorer to doesnot allow you to create a path of more then
> >> >256 characters.
> >> >Is there any way to overcome this problem.
> >> >
> >> >Regards
> >> >Jakir
> >> >
> >> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
> >news:<ilqcg0d093o3id1u1qpgngeqlmrp0js9d1@4ax.com>...
> >> >> That looks like the sort of code I would have written to do the
test.
> >The only problem
> >> >> here is that you did not actually print out the string you are
using,
> >so you are merely
> >> >> hoping that it is actually correct. I see nothing here that looks
> >wrong, but you didn't
> >> >> say what sort of string you typed in. Note that I think there is a
> >limitation on the
> >> >> length that any one component of a path can be, e.g., 256 bytes, but
> >with the \\?\ escape
> >> >> you can have a path of up to 32K characters. But it would be of the
> >form
> >> >> ...256chars...\....256 chars...\...256 chars...  etc. I'm not sure
why
> >this factoid sticks
> >> >> in my mind, but it is something you might want to check out. I
believe
> >that limitation is
> >> >> imposed by Windows, but a quick search didn't turn up anything.
> >> >> joe
> >> >>
> >> >> On 26 Jul 2004 08:30:03 -0700, jakir@coolgoose.com (Jakir) wrote:
> >> >>
> >> >> >Hi Joe,
> >> >> >
> >> >> >Please  see the sample application which I was trying....
> >> >> >
> >> >> >
> >> >> >#include <Windows.h>
> >> >> >
> >> >> >int main(int argc, char* argv[])
> >> >> >{
> >> >> >
> >> >> > char DirName[1024] = {0};
> >> >> > wchar_t wDirName[1024] = {0};
> >> >> > char Temp[1024] = {0};
> >> >> >
> >> >> > fgets(Temp, 1023, stdin); // Could be any long name
> >> >> >
> >> >> > strcpy(DirName, "\\\\?\\C:\\TempCM\\");
> >> >> > Temp[strlen(Temp)-1] = '\0';
> >> >> > strcat(DirName, Temp);
> >> >> >
> >> >> > printf("The Length is %d. \n", strlen(DirName));
> >> >> > MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName), wDirName,
> >1023);
> >> >> >
> >> >> > if(CreateDirectoryW(wDirName, NULL) == 0)
> >> >> > {
> >> >> > printf("%d \n", GetLastError());
> >> >> > }
> >> >> >
> >> >> > return 0;
> >> >> >}
> >> >> >
> >> >> >
> >> >> >Regards
> >> >> >Jakir
> >> >> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
> >news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
> >> >> >> It may be a limitation of Explorer...
> >> >> >> joe
> >> >> >>
> >> >> >> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:
> >> >> >>
> >> >> >> >If you also try to create a directory in Explorer of 300
character
> >it truncates
> >> >> >> >the directory...is this limitation of Windows....
> >> >> >> >
> >> >> >> >
> >> >> >> >Regards
> >> >> >> >Jakir
> >> >> >> >
> >> >> >> >
> >> >> >> >jakir@coolgoose.com (Jakir) wrote in message
> >news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
> >> >> >> >> Hi
> >> >> >> >>
> >> >> >> >> I want to create a directory with more then 300 characters. I
am
> >using
> >> >> >> >> the CreateDirectoryW function and prepending \\?\ to the path
> >> >> >> >> for eg..
> >> >> >> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
> >> >> >> >>  but the function fails with error 123.
> >> >> >> >>
> >> >> >> >> What could be the problem. I am working on Windows 2000.
> >> >> >> >>
> >> >> >> >> Regards
> >> >> >> >> Jakir
> >> >> >>
> >> >> >> Joseph M. Newcomer [MVP]
> >> >> >> email: newcomer@flounder.com
> >> >> >> Web: http://www.flounder.com
> >> >> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> >> >>
> >> >> Joseph M. Newcomer [MVP]
> >> >> email: newcomer@flounder.com
> >> >> Web: http://www.flounder.com
> >> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> >>
> >> Joseph M. Newcomer [MVP]
> >> email: newcomer@flounder.com
> >> Web: http://www.flounder.com
> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> >
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
alegr (1131)
7/29/2004 1:31:38 PM
I tried to prepend "\\?\" with the name but it doesn't work.  I also
tried the API GetVolumeInformation it returns the value 255 I could
not get any API that would modify that value. Even I could get any
information regarding to it in the registry.

Is there any way to modify that value.....from where that value is
read?

Regards
Jakir

Joseph M. Newcomer <newcomer@flounder.com> wrote in message news:<518hg0h5ht95vpollcjm3gc0boc841ista@4ax.com>...
> That's sort of what I suspected. The fact that with a component length of, say, 200, he
> seems unable to create, say, three 200-long components seemed odd, which is why I
> suggested the experiment of escaping the component as he creates each level. Not sure why
> this should make a difference, but who knows? 
> 
> Thanks for pointing out the API call; I don't play in this area so I wasn't aware of it.
> 				joe
> 
> On Wed, 28 Jul 2004 19:49:11 -0700, "Alexander Grigoriev" <alegr@earthlink.net> wrote:
> 
> >Call GetVolumeInformation and check MaxComponentLength. I suspect it is 256
> >or 255 for NTFS (it is 255 for VFAT). While \\?\ prefix allows to overcome
> >total path length limit, you cannot work around MaxComponentLength.
> >
> >"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
> >news:i61gg09qhfre1qd7b26vp19b327kgt04li@4ax.com...
> >> Hmmm. I've not played in this area, so I was relying on the documentation,
>  which states
> >> that long paths are possible. One thing I'd try, however, is to give the
>  name
> >>
> >> \\?\ccccccccccccccccc...cccccccccc
> >>
> >> as the name, rather than just
> >>
> >> ccccccccccccccccccccccccc
> >>
> >> It may be that you need to escape the name at each level.
> >> joe
> >>
> >> On 28 Jul 2004 11:02:56 -0700, jakir@coolgoose.com (Jakir) wrote:
> >>
> >> >Thanks Joe.
> >> >
> >> >For eg. the input contains 300 characters of 'a'.
> >> >
> >> >I too thought that the path limit of 32K characters would be of sort
> >> >256chars..\256chars... and so on. So I created a directory
> >> >"aaaaaaaa...(200 characters))" and programatically set my current
> >> >directory using SetCurrentDirectory to that and then tried to create a
> >> >directory of 200 characters say "bbbb...(200 Characters) but it to
> >> >fails.
> >> >
> >> >Windows Explorer to doesnot allow you to create a path of more then
> >> >256 characters.
> >> >Is there any way to overcome this problem.
> >> >
> >> >Regards
> >> >Jakir
> >> >
> >> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
>  news:<ilqcg0d093o3id1u1qpgngeqlmrp0js9d1@4ax.com>...
> >> >> That looks like the sort of code I would have written to do the test.
>  The only problem
> >> >> here is that you did not actually print out the string you are using,
>  so you are merely
> >> >> hoping that it is actually correct. I see nothing here that looks
>  wrong, but you didn't
> >> >> say what sort of string you typed in. Note that I think there is a
>  limitation on the
> >> >> length that any one component of a path can be, e.g., 256 bytes, but
>  with the \\?\ escape
> >> >> you can have a path of up to 32K characters. But it would be of the
>  form
> >> >> ...256chars...\....256 chars...\...256 chars...  etc. I'm not sure why
>  this factoid sticks
> >> >> in my mind, but it is something you might want to check out. I believe
>  that limitation is
> >> >> imposed by Windows, but a quick search didn't turn up anything.
> >> >> joe
> >> >>
> >> >> On 26 Jul 2004 08:30:03 -0700, jakir@coolgoose.com (Jakir) wrote:
> >> >>
> >> >> >Hi Joe,
> >> >> >
> >> >> >Please  see the sample application which I was trying....
> >> >> >
> >> >> >
> >> >> >#include <Windows.h>
> >> >> >
> >> >> >int main(int argc, char* argv[])
> >> >> >{
> >> >> >
> >> >> > char DirName[1024] = {0};
> >> >> > wchar_t wDirName[1024] = {0};
> >> >> > char Temp[1024] = {0};
> >> >> >
> >> >> > fgets(Temp, 1023, stdin); // Could be any long name
> >> >> >
> >> >> > strcpy(DirName, "\\\\?\\C:\\TempCM\\");
> >> >> > Temp[strlen(Temp)-1] = '\0';
> >> >> > strcat(DirName, Temp);
> >> >> >
> >> >> > printf("The Length is %d. \n", strlen(DirName));
> >> >> > MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName), wDirName,
>  1023);
> >> >> >
> >> >> > if(CreateDirectoryW(wDirName, NULL) == 0)
> >> >> > {
> >> >> > printf("%d \n", GetLastError());
> >> >> > }
> >> >> >
> >> >> > return 0;
> >> >> >}
> >> >> >
> >> >> >
> >> >> >Regards
> >> >> >Jakir
> >> >> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
>  news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
> >> >> >> It may be a limitation of Explorer...
> >> >> >> joe
> >> >> >>
> >> >> >> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir) wrote:
> >> >> >>
> >> >> >> >If you also try to create a directory in Explorer of 300 character
>  it truncates
> >> >> >> >the directory...is this limitation of Windows....
> >> >> >> >
> >> >> >> >
> >> >> >> >Regards
> >> >> >> >Jakir
> >> >> >> >
> >> >> >> >
> >> >> >> >jakir@coolgoose.com (Jakir) wrote in message
>  news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
> >> >> >> >> Hi
> >> >> >> >>
> >> >> >> >> I want to create a directory with more then 300 characters. I am
>  using
> >> >> >> >> the CreateDirectoryW function and prepending \\?\ to the path
> >> >> >> >> for eg..
> >> >> >> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
> >> >> >> >>  but the function fails with error 123.
> >> >> >> >>
> >> >> >> >> What could be the problem. I am working on Windows 2000.
> >> >> >> >>
> >> >> >> >> Regards
> >> >> >> >> Jakir
> >> >> >>
> >> >> >> Joseph M. Newcomer [MVP]
> >> >> >> email: newcomer@flounder.com
> >> >> >> Web: http://www.flounder.com
> >> >> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> >> >>
> >> >> Joseph M. Newcomer [MVP]
> >> >> email: newcomer@flounder.com
> >> >> Web: http://www.flounder.com
> >> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> >>
> >> Joseph M. Newcomer [MVP]
> >> email: newcomer@flounder.com
> >> Web: http://www.flounder.com
> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> >
> 
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
0
jakir (33)
7/29/2004 4:02:18 PM
MaxComponentName is a limitation of a filesystem driver. It may be hardcoded
there.

"Jakir" <jakir@coolgoose.com> wrote in message
news:f787ed40.0407290802.4b897fc5@posting.google.com...
> I tried to prepend "\\?\" with the name but it doesn't work.  I also
> tried the API GetVolumeInformation it returns the value 255 I could
> not get any API that would modify that value. Even I could get any
> information regarding to it in the registry.
>
> Is there any way to modify that value.....from where that value is
> read?
>
> Regards
> Jakir
>
> Joseph M. Newcomer <newcomer@flounder.com> wrote in message
news:<518hg0h5ht95vpollcjm3gc0boc841ista@4ax.com>...
> > That's sort of what I suspected. The fact that with a component length
of, say, 200, he
> > seems unable to create, say, three 200-long components seemed odd, which
is why I
> > suggested the experiment of escaping the component as he creates each
level. Not sure why
> > this should make a difference, but who knows?
> >
> > Thanks for pointing out the API call; I don't play in this area so I
wasn't aware of it.
> > joe
> >
> > On Wed, 28 Jul 2004 19:49:11 -0700, "Alexander Grigoriev"
<alegr@earthlink.net> wrote:
> >
> > >Call GetVolumeInformation and check MaxComponentLength. I suspect it is
256
> > >or 255 for NTFS (it is 255 for VFAT). While \\?\ prefix allows to
overcome
> > >total path length limit, you cannot work around MaxComponentLength.
> > >
> > >"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
> > >news:i61gg09qhfre1qd7b26vp19b327kgt04li@4ax.com...
> > >> Hmmm. I've not played in this area, so I was relying on the
documentation,
> >  which states
> > >> that long paths are possible. One thing I'd try, however, is to give
the
> >  name
> > >>
> > >> \\?\ccccccccccccccccc...cccccccccc
> > >>
> > >> as the name, rather than just
> > >>
> > >> ccccccccccccccccccccccccc
> > >>
> > >> It may be that you need to escape the name at each level.
> > >> joe
> > >>
> > >> On 28 Jul 2004 11:02:56 -0700, jakir@coolgoose.com (Jakir) wrote:
> > >>
> > >> >Thanks Joe.
> > >> >
> > >> >For eg. the input contains 300 characters of 'a'.
> > >> >
> > >> >I too thought that the path limit of 32K characters would be of sort
> > >> >256chars..\256chars... and so on. So I created a directory
> > >> >"aaaaaaaa...(200 characters))" and programatically set my current
> > >> >directory using SetCurrentDirectory to that and then tried to create
a
> > >> >directory of 200 characters say "bbbb...(200 Characters) but it to
> > >> >fails.
> > >> >
> > >> >Windows Explorer to doesnot allow you to create a path of more then
> > >> >256 characters.
> > >> >Is there any way to overcome this problem.
> > >> >
> > >> >Regards
> > >> >Jakir
> > >> >
> > >> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
> >  news:<ilqcg0d093o3id1u1qpgngeqlmrp0js9d1@4ax.com>...
> > >> >> That looks like the sort of code I would have written to do the
test.
> >  The only problem
> > >> >> here is that you did not actually print out the string you are
using,
> >  so you are merely
> > >> >> hoping that it is actually correct. I see nothing here that looks
> >  wrong, but you didn't
> > >> >> say what sort of string you typed in. Note that I think there is a
> >  limitation on the
> > >> >> length that any one component of a path can be, e.g., 256 bytes,
but
> >  with the \\?\ escape
> > >> >> you can have a path of up to 32K characters. But it would be of
the
> >  form
> > >> >> ...256chars...\....256 chars...\...256 chars...  etc. I'm not sure
why
> >  this factoid sticks
> > >> >> in my mind, but it is something you might want to check out. I
believe
> >  that limitation is
> > >> >> imposed by Windows, but a quick search didn't turn up anything.
> > >> >> joe
> > >> >>
> > >> >> On 26 Jul 2004 08:30:03 -0700, jakir@coolgoose.com (Jakir) wrote:
> > >> >>
> > >> >> >Hi Joe,
> > >> >> >
> > >> >> >Please  see the sample application which I was trying....
> > >> >> >
> > >> >> >
> > >> >> >#include <Windows.h>
> > >> >> >
> > >> >> >int main(int argc, char* argv[])
> > >> >> >{
> > >> >> >
> > >> >> > char DirName[1024] = {0};
> > >> >> > wchar_t wDirName[1024] = {0};
> > >> >> > char Temp[1024] = {0};
> > >> >> >
> > >> >> > fgets(Temp, 1023, stdin); // Could be any long name
> > >> >> >
> > >> >> > strcpy(DirName, "\\\\?\\C:\\TempCM\\");
> > >> >> > Temp[strlen(Temp)-1] = '\0';
> > >> >> > strcat(DirName, Temp);
> > >> >> >
> > >> >> > printf("The Length is %d. \n", strlen(DirName));
> > >> >> > MultiByteToWideChar(CP_ACP, 0, DirName, strlen(DirName),
wDirName,
> >  1023);
> > >> >> >
> > >> >> > if(CreateDirectoryW(wDirName, NULL) == 0)
> > >> >> > {
> > >> >> > printf("%d \n", GetLastError());
> > >> >> > }
> > >> >> >
> > >> >> > return 0;
> > >> >> >}
> > >> >> >
> > >> >> >
> > >> >> >Regards
> > >> >> >Jakir
> > >> >> >Joseph M. Newcomer <newcomer@flounder.com> wrote in message
> >  news:<3lf3g0pm2b8eqd24kmd98hqq2aka2sae3r@4ax.com>...
> > >> >> >> It may be a limitation of Explorer...
> > >> >> >> joe
> > >> >> >>
> > >> >> >> On 23 Jul 2004 15:45:18 -0700, jakir@coolgoose.com (Jakir)
wrote:
> > >> >> >>
> > >> >> >> >If you also try to create a directory in Explorer of 300
character
> >  it truncates
> > >> >> >> >the directory...is this limitation of Windows....
> > >> >> >> >
> > >> >> >> >
> > >> >> >> >Regards
> > >> >> >> >Jakir
> > >> >> >> >
> > >> >> >> >
> > >> >> >> >jakir@coolgoose.com (Jakir) wrote in message
> >  news:<f787ed40.0407231000.5f3b5553@posting.google.com>...
> > >> >> >> >> Hi
> > >> >> >> >>
> > >> >> >> >> I want to create a directory with more then 300 characters.
I am
> >  using
> > >> >> >> >> the CreateDirectoryW function and prepending \\?\ to the
path
> > >> >> >> >> for eg..
> > >> >> >> >>   CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name
> > >> >> >> >>  but the function fails with error 123.
> > >> >> >> >>
> > >> >> >> >> What could be the problem. I am working on Windows 2000.
> > >> >> >> >>
> > >> >> >> >> Regards
> > >> >> >> >> Jakir
> > >> >> >>
> > >> >> >> Joseph M. Newcomer [MVP]
> > >> >> >> email: newcomer@flounder.com
> > >> >> >> Web: http://www.flounder.com
> > >> >> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> > >> >>
> > >> >> Joseph M. Newcomer [MVP]
> > >> >> email: newcomer@flounder.com
> > >> >> Web: http://www.flounder.com
> > >> >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> > >>
> > >> Joseph M. Newcomer [MVP]
> > >> email: newcomer@flounder.com
> > >> Web: http://www.flounder.com
> > >> MVP Tips: http://www.flounder.com/mvp_tips.htm
> > >
> >
> > Joseph M. Newcomer [MVP]
> > email: newcomer@flounder.com
> > Web: http://www.flounder.com
> > MVP Tips: http://www.flounder.com/mvp_tips.htm


0
alegr (1131)
7/29/2004 7:39:33 PM
Reply:

Similar Artilces:

Report Load Failed
when i deploy my project, crystel report have an error "report load failed".This project made in C# desktop application 2008. In solution, there is no error beacuse the crystel report path work well in solution but no well in deployment. ...

Excel fails to save properly
I have a daily exercise in which I copy a web-based datagrid and paste it into an Excel workbook. It's typically up to 6,000 rows +/- and 15 columns wide. It takes a while to paste. After that I block format remove text-wrap and adjust row height and column widths to fit, change the worksheet tab to a description name, then attempt to SAVE AS "XXXX_YYYY-MM-DD.XLS". At this point the worksheet usually becomes unresponsive but not always. If I close Excel and then reopen it, the recovered file can eventually be repaired and saved. Is this a known problem? I suspect th...

FAiled instalation of Exchange 2003
I have just arrived on site and found some one has tried to install exchange 2003 in the domain and then just deleted all the objects before they left. This is now causing great problems, as I have reinstalled exchange 2003 but it, believes that there is a virtual site "old server name” and I can not get rid of it. Every time I create a mail box it does not appear anywhere. Could anyone point me at an article that shows you how to undo all forest and domain preps from your AD so that I may redeploy this server in a working state? I have removed my new server by running the remoevor...

MFC/MDI App fails with "An invalid argument was encountered." on click File menu item.
A message is popping up "An invalid argument was encountered." when the user clicks on the File menu item. I have an MDI app and it appears that the message occurs before any document is selected. When a document file has been opened, the message also pops up, again when the File menu is clicked. The file menu itself never opens. I found the place in VS .NET 2005 that is producing the message: - afxres.rc with the line: AFX_IDS_INVALID_ARG_EXCEPTION "An invalid argument was encountered." The code that uses this seems to be in except.cpp as: IMPLEMENT_DYNAMIC(CInv...

Microsoft CRM 1.2 database expert failed
This message comes from the Microsoft CRM Server Setup. The crm30svrsetup.log has error - 14:36:41| Error| Check ExportXmlValidator : Failure: Microsoft CRM 1.2 database export failed. When you press help I get a "Mal-formed XML found in Microsoft CRM 1.2 Exported Saved Queries" which explains nothing! This is supprising because we have made of making minimal change to CRM 1.2. Somebody else must have a similar erro! Thanks!!r -- Bob H I'm also getting this error. I'm calling Microsoft right now. We have made very minimal customizations. email me at dkuhlman@etec...

stretchdibits fails
This is my function that I wrote to extract AVI frames from AVI file. Actually I wanted to get avi frames into DIB format, converter it DDB and then save it to a file, This is a function that I write to do so, Here SetDIBits function returns O (Error), I don't know what am I doing wrong, Could anyone please tell where I am wrong. BOOL CAviFile::ExtractAVIFrames(CString szFileName) { AVIFileInit(); PAVIFILE avi; int res = AVIFileOpen(&avi, szFileName, OF_READ, NULL); if (res!=AVIERR_OK) { //an error occures if (avi != NULL) AVIFileRelea...

Outlook 2002 and IMAP: Fails to stay connected to IMAP server
Good day, everyone! I'm using Outlook 2002 and Gmail's IMAP service. I'm trying to figure out where the fault lies with my issue. My issue is that Outlook will lose connection to Gmail's IMAP service after a period of inactivity, which prevents me from knowing when I receive new email during this loss of connection. I have to enable a POP3 check to indicate I have mail in case the connection has failed. I have this incoming mail then automatically deleted. Has anyone had this problem? Is this an issue with Outlook or Gmail's IMAP service or just the nature of t...

ExMerge fails ?
Not sure what is making Exmerge fail. From an Win2003+Exch2003 Sp1 Server Tools, I download the latest Exchmerge from microsoft.com. I place the all extracted Exchmerge files under \Exchsrv\Bin Then I launch Exmerge accordingly. I am getting an error message when opening the Mailbox Store. I am logged on as Domain Admins+Exchange Full Admin permissions. The information stores are running OK. Any idea what's wrong ? I tried this on multiple functional mailboxes and I keep getting the same error... [10:38:19] Found 1604 mailbox(es) homed on database 'FIRST STORAGE GROUP/MAILBOX STO...

Why is collection failing?
I'm creating a wrapper class for a collection object, mainly so I can test whether a given records exists. I'm baffled as to why I'm getting "Invalid procedure or argument" in the exists function when I try to extract the value, whether it actually exists or not. I've tried collection.item and collection(item), same result. BTW, the values are numbers that I convert to strings. Option Compare Database Option Explicit 'this class object extends the collection object to include an 'exists' boolean function Private colStatus As VBA.Collection Private S...

CreateDirectoryW fails
Hi I want to create a directory with more then 300 characters. I am using the CreateDirectoryW function and prepending \\?\ to the path for eg.. CreateDirectoryW("\\\\?\\C:\\Temp\\..." some long name but the function fails with error 123. What could be the problem. I am working on Windows 2000. Regards Jakir Would it hurt to tell us what error 123 means? (I looked it up and it says the fllename syntax is illegal). Give your code snippet below, I'm not surprised. Take a look at CreateDirectoryW. What is its argument type? A Unicode string. So you should supply a Unic...

Users failing to log in to Exchange on some PCs but not others.
Last week a number of laptop users reported that whenever they run Outlook 2002 to access exchange they are being prompted with a login dialogue. As they are already authorised network users this should not be happening. I took the most important users laptop and checked the settings to find everything was OK. I started a test profile and tried to set up the user there. Same problem. I went to another PC and set up a new profile and accessed exchange immediately. Back at the laptop, I reinstalled the Outlook Suite, The Network components and anything else I could think may be at fault, but sti...

Operation Failed error
When I attempt to send a worksheet via email (Outlook 2000) I get "Operation Failed" error. Any ideas? ...

dsquery failed:The logon attempt failed
Hello, I'm running Windows 2008 Server domain functional level 2008. When I run the dsquery command "dsquery user -u example@domain.com" I get the error message "dsquery failed:The logon attempt failed". Other dsquery commands work fine including "dsquery user -name Example*" and "dsquery user ou=example,dc=domain,dc=com". Any ideas on why I would get the 'dsquery failed:The logon attempt failed' message and how I can fix it? Thank you. -- David dach3 wrote: > Hello, I'm running Windows 2008 Server domain functional ...

Exchange services fail to start
On my Exchange 2003 server when the server reboots the following services fail to start:- MS Exchange System Attendant MS Exchange Information Store MS Exchange MTA Stacks If I wait for about 2-3 minutes I can start the services ok. Is there any known issues and fixes for this and does anyone no of a way to delay the startup of these services? Thanks in advance, Kevin What errors do you see in the Application Log via Event Viewer? -- Mark Fugatt Exchange MVP http://www.exchangetrainer.com http://www.msexchange.org "Kevin Howell" <kevin.howell@nospampleasedatamonline.co.uk...

Reimport XML fails
Followed the instructions here: http://office.microsoft.com/en-us/excel/HA011019641033.aspx#create_map to import an RSS feed for Craig's List: http://newjersey.craigslist.org/zip/index.rss. It works great the first time, but if I want to update it, nothing happens??? Do I have to save the file each time and start with a fresh empty file with just the mapping? LMK - TIA ed ...

DNS test connect to mail servers failed
I ran a DNS test from dnsreport.com and got a failure on "Connect to mail servers". The message was: ERROR: I could not complete a connection to one or more of your mailservers: mail.itsatx.com: The mailserver terminated the connection before the transaction was complete (state 4). This is not RFC compliant, and therefore either due to an error, or it may be the result of a non-RFC-compliant mailserver or non-RFC-compliant anti-spam program. Does anyone know how to correct this or what properties I need to adjust? Bruce Along the lines of my response to your other post, do yo...

<Dim fd As FileDialog> fails to compile
Hello all, If you have ever experienced such an error, please advise what can be the solution to compile a project? When I try to do this I get a "User-defined type is not defined" error. My guess is that I have to set up some reference, but if so - which one? Thank you, Eugene. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200705/1 In news:7231e6fc4150f@uwe, Eugene via AccessMonster.com <u32520@uwe> wrote: > Hello all, > > If you have ever experienced such an error, please advise what can be > the sol...

outlook send receive fail
when I click on the send receive button, I get a pop up message saying the operation failed. It worked fine before today. Any thoughts would be appreciated. I am having trouble with the send part of that. Has yours been fixed, yet? What did you do? >-----Original Message----- >when I click on the send receive button, I get a pop up >message saying the operation failed. It worked fine >before today. > >Any thoughts would be appreciated. >. > ...

ON_UPDATE_COMMAND_UI fails
Hi, I have a pop-up menu which appears when the user right clicks on an item in a CTreeView. I created a UI update function for one of the menu items, and mapped it to the item ID using ON_UPDATE_COMMAND_UI. However, the UI update function does not get called until AFTER the menu item has been selected--which of course does nothing for me since at that point the menu is no longer being displayed. I was expecting the function to get called before the menu was displayed, so the menu item in question would be updated before being shown on the screen. Does anyone have any idea of what could be wr...

Debug image fails to load.
Hi, I created an OS design with KITL, Kernel debugger enabled in Debug mode. But when i try to load the image to the CEPC it fails to boot. I am attaching the log here. ------ SERIAL PORT LOG starts ----------- Microsoft Windows CE Ethernet Bootloader Common Library Version 1.0 Built Dec 9 2002 18:35:13 Copyright (c) 2000-2001 Microsoft Corporation Microsoft Windows CE Ethernet Bootloader 3.3 for CE/PC (Feb 6 2003) Boot Args @ 0x1F136 and ucLoaderFlags is 1 PCI Device Configurations (3 PCI bus(es) present)... ======================================================== Bus, Devi...

Logon failed
I am using Live Mail as my default program. When I try to sent a attachment by clicking mail attachment in word 2007 to go through live mail I get this notice. Logon failed. You must log on to Microsoft Exchange to access your address book. What does this mean? Using Office works 2007. W7 professional. Any help would be appreciated. Grumpy Are you using Word's "Send Email" feature? Or are you in WLMail and selecting "Attach", then locating a file via Windows Explorer? "Grumpy" <Grumpy@discussions.microsoft.com> wrote ...

Installation of CRM v3.0c fails with Outlook 2007 #2
There is this thread, which I wish to reply to but don't know how. Thread URL: http://groups.google.com.my/group/microsoft.public.crm/browse_thread/thread/9a8dd21187c63f8f/70ec92d8b2203f30?hl=en&lnk=st&q=The+installed+version+of+Microsoft+Outlook+is+not+supported+by+the+Microsoft+CRM+client.+Please+upgrade+to+the+current+release+of+Microsoft+Office+Outlook.#70ec92d8b2203f30 Please see my solution at: http://zenetlife.blogspot.com/2008/01/installing-ms-dynamics-crm-client-v3c.html Hope this is useful. Regards, Eunice Hmmnnn - unfortunately, the conclusion in your blog is inco...

Publisher Fails To Open
I have been using Publisher, which came bundled with Microsoft Office 2000 Premium, for a year and a half. Now, for reasons I cannot determine, it simply fails to open, whether I use the shortcut on the desktop or the start menu. I get no error message of any sort -- the desktop just continues unaltered. I have tried uninstalling Microsoft Office and reinstalling it and still cannot open Publisher, though the other programs bundled in Microsoft Office open just fine. Any advice? -- Bill B Delete the shortcut and create a new one. To do this, follow these steps: 1.Delete the broken...

AfxGetInstanceHandle failed when calling it from a COM Event sink callback
I got an Assertion failed error from AfxGetInstanceHandle when calling it from a COM Event sink callback(which will be called from a local com event source in another process). it happened at ".../afxwin1.inl Line: 23". AfxGetInstanceHandle works fine if I call it from a normal function. who knows about this problem? thanks. MFC? Perhaps your callback if written in MFC needs to be protected with AFX_MANAGE_STATE? ...

Upgrade from 1.2 to 3 fails
This is what i receive during the install of CRM v3, any thoughts? Action Microsoft.Crm.Setup.Server.InstallDatabaseAction failed. Invalid object name 'dbo.MSmerge_contents'. Could not use view or function 'ctsv_2DCF979A518D4783A9A133A2F26C946D' because of binding errors. Invalid object name 'dbo.MSmerge_contents'. Could not use view or function 'ctsv_2DCF979A518D4783A9A133A2F26C946D' because of binding errors. Invalid object name 'dbo.MSmerge_contents'. Could not use view or function 'ctsv_2DCF979A518D4783A9A133A2F26C946D' because of binding...