-=Wok=- Blog


Your Network. Our Passion (Networking ed altro)
Anno 2008

Anno 2007

Anno 2006

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

Se includete in un batch di logon un altro batch potreste non veder eseguiti i comando richiesti, controllando nella finestra DOS che si apre durante l'esecuzione trovereste:

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

 

Ecco come porre rimedio al problema.

http://support.microsoft.com/kb/156276/en-us

 

Article ID       :  156276

Last Review   :  November 1, 2006

Revision        :  2.2

This article was previously published under Q156276

SYMPTOMS


When you call out CreateProcess on Cmd.exe, for example:

CreateProcess(NULL, "cmd /c copy file1 file2", ....),

and the current directory has been set to a universal naming convention (UNC), Cmd.exe returns the following message:

'<UNC path>' is an invalid current directory path. UNC paths are not supported.
Defaulting to Windows directory.

CAUSE


Cmd.exe checks to verify if a UNC name is used for the current directory. It does this because a UNC name may cause problems with child processes launched from such a console when that console is exited or halted. Microsoft Windows NT versions prior to 4.0 did not check this; thus it was possible to use a UNC name as a current directory.

RESOLUTION


Obtain the updated Cmd.exe. You must also make a registry entry to be able to use a UNC path as the current directory.

WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows NT to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.

Under the registry path:

   HKEY_CURRENT_USER
      \Software
         \Microsoft
            \Command Processor
add the value DisableUNCCheck REG_DWORD and set the value to 0 x 1 (Hex). 

WARNING: If you enable this feature and start a Console that has a current directory of an UNC name, start applications from that Console, and then close the Console, it could cause problems in the applications started from that Console.

STATUS


Microsoft has confirmed this to be a problem in Windows NT version 4.0. This problem was corrected in the latest Microsoft Windows NT 4.0 U.S. Service Pack. For information on obtaining the service pack, query on the following word in the Microsoft Knowledge Base (without the spaces):

S E R V P A C K





APPLIES TO

  Microsoft Windows XP Home Edition

  Microsoft Windows XP Professional

  Microsoft Windows 2000 Server

  Microsoft Windows NT Workstation 4.0 Developer Edition

  Microsoft Windows NT Server 4.0 Standard Edition

Categoria: Windows
giovedì, 09 nov 2006 Ore. 13.42



  • Views Home Page: 87.866
  • Views Posts: 213.238
  • Views Gallerie: 14.266
  • n° Posts: 115
  • n° Commenti: 110
Copyright © 2002-2007 - Blogs 2.0
dotNetHell.it | Home Page Blogs
ASP.NET 2.0 Windows 2003