mklnk / mklink problem

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 29, 2008
5
0
#1
Why are mklnk and mklink creating directories instead of links?

[C:\Program Files]
>ver

TCC 10.00.57 Windows XP [Version 5.1.2600]

[C:\Program Files]
>echo %@fstype[c:]
NTFS

[C:\Program Files]
>*dir slick*

Volume in drive C is pkback# 001 Serial number is b06a:6f81
Directory of C:\Program Files\slick*

12/27/2008 8:45 <DIR> SlickEdit 2007
2/02/2009 10:18 <DIR> SlickEdit 2008
1/30/2009 15:51 <DIR> SlickEdit 2009 Beta1
2/18/2009 11:04 <DIR> SlickEdit 2009 Beta2
2/25/2009 16:22 <DIR> SlickEdit 2009 Beta3
1/25/2009 11:25 <DIR> SlickEdit Tools v2.0.3

[C:\Program Files]
>mklnk "SlickEdit 2009 Beta3"\ "SlickEdit 2009"
TCC: (Sys) The process cannot access the file because it is being used by another process.
"C:\Program Files\SlickEdit 2009"

[C:\Program Files]
>*dir slick*

Volume in drive C is pkback# 001 Serial number is b06a:6f81
Directory of C:\Program Files\slick*

12/27/2008 8:45 <DIR> SlickEdit 2007
2/02/2009 10:18 <DIR> SlickEdit 2008
2/27/2009 10:32 <DIR> SlickEdit 2009
1/30/2009 15:51 <DIR> SlickEdit 2009 Beta1
2/18/2009 11:04 <DIR> SlickEdit 2009 Beta2
2/25/2009 16:22 <DIR> SlickEdit 2009 Beta3
1/25/2009 11:25 <DIR> SlickEdit Tools v2.0.3

[C:\Program Files]
>rmdir "SlickEdit 2009"\

[C:\Program Files]
>mklink "SlickEdit 2009" ".\SlickEdit 2009 Beta3"\
TCC: (Sys) The request is not supported.

[C:\Program Files]
>mklink /D "SlickEdit 2009" ".\SlickEdit 2009 Beta3"\
TCC: (Sys) The request is not supported.

[C:\Program Files]
>mklink /H "SlickEdit 2009" ".\SlickEdit 2009 Beta3"\
TCC: (Sys) The request is not supported.

[C:\Program Files]
>mklink /J "SlickEdit 2009" ".\SlickEdit 2009 Beta3"\
TCC: (Sys) The process cannot access the file because it is being used by another process.
"SlickEdit 2009"

[C:\Program Files]
>*dir slick*

Volume in drive C is pkback# 001 Serial number is b06a:6f81
Directory of C:\Program Files\slick*

12/27/2008 8:45 <DIR> SlickEdit 2007
2/02/2009 10:18 <DIR> SlickEdit 2008
2/27/2009 10:34 <DIR> SlickEdit 2009
1/30/2009 15:51 <DIR> SlickEdit 2009 Beta1
2/18/2009 11:04 <DIR> SlickEdit 2009 Beta2
2/25/2009 16:22 <DIR> SlickEdit 2009 Beta3
1/25/2009 11:25 <DIR> SlickEdit Tools v2.0.3

(Sorry about the formatting; I am copying from the TC window and pasting into the forum message. Is there any way to fix the formatting of the dir listing?)
 

rconn

Administrator
Staff member
May 14, 2008
10,103
85
#2
Number8 wrote:

> Why are mklnk and mklink creating directories instead of links?
None of that is reproducible here (nor have we had any other reports of
that behavior), so I'd suspect a problem with your system (possibly the
redirector).

There is definitely no way that TCC could be creating a directory; it's
calling a Windows API (DeviceIoControl) to create the junction.

MKLINK is only supported in Windows Vista and later.

What version of Windows are you running?

Rex Conn
JP Software
 
May 29, 2008
5
0
#3
None of that is reproducible here (nor have we had any other reports of
that behavior), so I'd suspect a problem with your system (possibly the
redirector).

There is definitely no way that TCC could be creating a directory; it's
calling a Windows API (DeviceIoControl) to create the junction.
Thanks for the reply. I overlooked the note about Vista and MKLINK.

Since you suggested a local system problem, I tried sysinternals' Junction.exe, and got the same result -- directory created instead of a link.
 
#4
Number8 wrote:
| ---Quote (Originally by rconn)---
| None of that is reproducible here (nor have we had any other reports
| of
| that behavior), so I'd suspect a problem with your system (possibly
| the
| redirector).
|
| There is definitely no way that TCC could be creating a directory;
| it's
| calling a Windows API (DeviceIoControl) to create the junction.
| ---End Quote---
| Thanks for the reply. I overlooked the note about Vista and MKLINK.
|
| Since you suggested a local system problem, I tried sysinternals'
| Junction.exe, and got the same result -- directory created instead of
| a link.

Could this (i.e., the use by the Windows Installer of an API call which in
Vista creates a junction, but in XP a directory) be the explanation why the
V9 installer, when it was given the name of an existing junction as the
installation directory, removed the junction and created a directory in its
place?
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
10,103
85
#5
Steve Fábián wrote:

> Number8 wrote:
> | ---Quote (Originally by rconn)---
> | None of that is reproducible here (nor have we had any other reports
> | of
> | that behavior), so I'd suspect a problem with your system (possibly
> | the
> | redirector).
> |
> | There is definitely no way that TCC could be creating a directory;
> | it's
> | calling a Windows API (DeviceIoControl) to create the junction.
> | ---End Quote---
> | Thanks for the reply. I overlooked the note about Vista and MKLINK.
> |
> | Since you suggested a local system problem, I tried sysinternals'
> | Junction.exe, and got the same result -- directory created instead of
> | a link.
>
> Could this (i.e., the use by the Windows Installer of an API call which in
> Vista creates a junction, but in XP a directory) be the explanation why the
> V9 installer, when it was given the name of an existing junction as the
> installation directory, removed the junction and created a directory in its
> place?
No - the Windows Installer isn't involved at all. The OP was reporting
a problem with the TCC internal MKLNK command creating a directory
instead of a junction. (But since junction.exe has the same problem, it
appears to be a local issue.)

Rex Conn
JP Software
 
#6
rconn wrote:
| Steve Fábián wrote:
|
|
| ---Quote---
|| Number8 wrote:
||| ---Quote (Originally by rconn)---
||| None of that is reproducible here (nor have we had any other reports
||| of
||| that behavior), so I'd suspect a problem with your system (possibly
||| the
||| redirector).
|||
||| There is definitely no way that TCC could be creating a directory;
||| it's
||| calling a Windows API (DeviceIoControl) to create the junction.
||| ---End Quote---
||| Thanks for the reply. I overlooked the note about Vista and MKLINK.
|||
||| Since you suggested a local system problem, I tried sysinternals'
||| Junction.exe, and got the same result -- directory created instead
||| of a link.
||
|| Could this (i.e., the use by the Windows Installer of an API call
|| which in Vista creates a junction, but in XP a directory) be the
|| explanation why the V9 installer, when it was given the name of an
|| existing junction as the installation directory, removed the
|| junction and created a directory in its place?
| ---End Quote---
| No - the Windows Installer isn't involved at all. The OP was
| reporting
| a problem with the TCC internal MKLNK command creating a directory
| instead of a junction. (But since junction.exe has the same problem,
| it appears to be a local issue.)

I think you misunderstood me. I was postulating the posibility that TCC's
MKLINK command (the one intended for Vista only, not the older MKLNK) and
the Windows Installer both call the same API which in Vista correctly
creates a junction, but in XP creates a directory even if the new directory
replaces a junction with the same name. If my postulate is true, the problem
is still not in TCC, but in the API. However, what works against the
postulate is that MKLINK/J works correctly on my WinXP (creates a junction).
The whole issue is not significant for me, because I now use a different
naming convention, thus installation directories are now always real ones,
not junctions.
--
Steve
 

rconn

Administrator
Staff member
May 14, 2008
10,103
85
#7
Steve Fábián wrote:

> rconn wrote:
> | No - the Windows Installer isn't involved at all. The OP was
> | reporting
> | a problem with the TCC internal MKLNK command creating a directory
> | instead of a junction. (But since junction.exe has the same problem,
> | it appears to be a local issue.)
>
> I think you misunderstood me. I was postulating the posibility that TCC's
> MKLINK command (the one intended for Vista only, not the older MKLNK) and
> the Windows Installer both call the same API which in Vista correctly
> creates a junction, but in XP creates a directory even if the new directory
> replaces a junction with the same name. If my postulate is true, the problem
> is still not in TCC, but in the API. However, what works against the
> postulate is that MKLINK/J works correctly on my WinXP (creates a junction).
> The whole issue is not significant for me, because I now use a different
> naming convention, thus installation directories are now always real ones,
> not junctions.
The installer never tries to create a junction, and it definitely does
not call the Vista-only API (which would result in crashing the
installer, not creating a directory).

MKLINK /J calls MKLNK to create the junction, so it never makes the
Vista API call.

TCC checks the Windows version and won't let you make a MKLINK call to
the Vista API from XP.

Rex Conn
JP Software
 
#8
rconn wrote:
| The installer never tries to create a junction, and it definitely does
| not call the Vista-only API (which would result in crashing the
| installer, not creating a directory).
|
| MKLINK /J calls MKLNK to create the junction, so it never makes the
| Vista API call.


Thanks for the explanation.

| TCC checks the Windows version and won't let you make a MKLINK call to
| the Vista API from XP.

I know, it gives the perfect error message: The request is not supported.

--
Steve