View Full Version : CMD and UNC Paths in Login Script


David
11-03-2005, 02:56 PM
I am running a .cmd file as a login script on Domain Controllers.

The script works fine on 2k boxes but every time it runs on a 2k3 box, the
following error message appears:

CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.


The script still runs fine, but is there any way i can get rid of this error
message?


Thanks!

Jerold Schulman
11-03-2005, 04:23 PM
On Thu, 3 Nov 2005 14:56:26 -0000, "David" <daveh@mydomain.com> wrote:

>I am running a .cmd file as a login script on Domain Controllers.
>
>The script works fine on 2k boxes but every time it runs on a 2k3 box, the
>following error message appears:
>
>CMD.EXE was started with the above path as the current directory.
>UNC paths are not supported. Defaulting to Windows directory.
>
>
>The script still runs fine, but is there any way i can get rid of this error
>message?
>
>
>Thanks!
>

Add the following to the logon script:

REG ADD "HKCU\Software\Microsoft\Command Processor" /V DisableUNCCheck /T REG_DWORD /F /D 1

The second time it runs for a user, the message will be gone.

NOTE: REG.EXE is built into Windows XP and Windows Server 2003.
It is installed on Windows 2000 from the Support Tools folder on the Windows 2000 CD-ROM.

Alternately, store the following DisUNCCK.reg file in the netlogon share of each DC:
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
"DisableUNCCheck"=dword:00000001


In the logon script, add
regedit /s %LOGONSERVER%\NETLOGON\DisUNCCK.reg

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com

ThorstenK
11-07-2005, 01:00 PM
perhaps just beginn the script with a "cls" to get rid of the message.

"David" <daveh@mydomain.com> schrieb im Newsbeitrag
news:436a251b$0$48889$892e0abb@auth.newsreader.octanews.com...
>I am running a .cmd file as a login script on Domain Controllers.
>
> The script works fine on 2k boxes but every time it runs on a 2k3 box, the
> following error message appears:
>
> CMD.EXE was started with the above path as the current directory.
> UNC paths are not supported. Defaulting to Windows directory.
>
>
> The script still runs fine, but is there any way i can get rid of this
> error message?
>
>
> Thanks!
>

Al Dunbar
11-08-2005, 02:15 AM
"ThorstenK" <my.name@gmx.de> wrote in message
news:OYdjos54FHA.2548@TK2MSFTNGP10.phx.gbl...
> perhaps just beginn the script with a "cls" to get rid of the message.

That's what we do, and nobody has complained yet about it.

/Al

> "David" <daveh@mydomain.com> schrieb im Newsbeitrag
> news:436a251b$0$48889$892e0abb@auth.newsreader.octanews.com...
>>I am running a .cmd file as a login script on Domain Controllers.
>>
>> The script works fine on 2k boxes but every time it runs on a 2k3 box,
>> the following error message appears:
>>
>> CMD.EXE was started with the above path as the current directory.
>> UNC paths are not supported. Defaulting to Windows directory.
>>
>>
>> The script still runs fine, but is there any way i can get rid of this
>> error message?
>>
>>
>> Thanks!
>>
>
>

Mark V
11-08-2005, 04:15 AM
In microsoft.public.win2000.cmdprompt.admin Jerold Schulman wrote:

> On Thu, 3 Nov 2005 14:56:26 -0000, "David" <daveh@mydomain.com>
> wrote:
>
>>I am running a .cmd file as a login script on Domain
>>Controllers.
>>
>>The script works fine on 2k boxes but every time it runs on a
>>2k3 box, the following error message appears:
>>
>>CMD.EXE was started with the above path as the current
>>directory. UNC paths are not supported. Defaulting to Windows
>>directory.
[ ]

> Add the following to the logon script:
>
> REG ADD "HKCU\Software\Microsoft\Command Processor" /V
> DisableUNCCheck /T REG_DWORD /F /D 1

That's interesting Jerold. XP, W2K3 only?
It seems not to have yet made it into a Tip. At least, a search on
DisableUNCCheck
does not hit.
[ ]

Michael Harris \(MVP\)
11-08-2005, 05:00 AM
> ... At least, a search on
> DisableUNCCheck
> does not hit.


Cmd.exe does not support UNC names as the current directory

http://support.microsoft.com/?kbid=156276

from a google search for DisableUNCCheck ...

--
Michael Harris
Microsoft MVP Scripting

Jerold Schulman
11-09-2005, 06:55 PM
On Mon, 07 Nov 2005 23:15:25 -0500, Mark V <notvalid@nul.invalid> wrote:

>In microsoft.public.win2000.cmdprompt.admin Jerold Schulman wrote:
>
>> On Thu, 3 Nov 2005 14:56:26 -0000, "David" <daveh@mydomain.com>
>> wrote:
>>
>>>I am running a .cmd file as a login script on Domain
>>>Controllers.
>>>
>>>The script works fine on 2k boxes but every time it runs on a
>>>2k3 box, the following error message appears:
>>>
>>>CMD.EXE was started with the above path as the current
>>>directory. UNC paths are not supported. Defaulting to Windows
>>>directory.
>[ ]
>
>> Add the following to the logon script:
>>
>> REG ADD "HKCU\Software\Microsoft\Command Processor" /V
>> DisableUNCCheck /T REG_DWORD /F /D 1
>
>That's interesting Jerold. XP, W2K3 only?
>It seems not to have yet made it into a Tip. At least, a search on
> DisableUNCCheck
>does not hit.
>[ ]

All versions of NT, from NT 4.0 - NT 5.2 (and beyond).
It will make the tips soon.

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com