Fellow Statalisters
I use the very latest Stata Version 16 (dated 11 Dec 2019) under Windows 10, and all of a sudden I find that I cannot really use the shell command any more in the way that I have always routinely taken for granted in the past. This is because, when I am using Stata in a current directory which is a networked drive and I type
shell
a Windows 10 CMD window opens and tells me that I cannot use the network drive as the current folder, because UNC paths are not supported as possible current directories, and changes the current directory to C:\Windows. An example of this behaviour is given below:
**** BEGINNING OF CMD OUTPUT - CUT HERE
'\\icnas4.cc.ic.ac.uk\rnewson\rnewson\projects\sme eton\pracnonparstats\ansmlatex'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
Microsoft Windows [Version 10.0.17134.1184]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Windows>
**** END OF CMD OUTPUT - CUT HERE
This seems to be saying that Windows 10 no longer does as it is asked by Stata when a CMD window is initiated using a shell command, at least on my machine, because Windows 10 no longer allows the current folder to be a networked drive..
I have encountered this behaviour from my machine before, both when launching a CMD window from Stata using shell and when opening a CMD window from within TextPad (my favourite text editor for Windows which comes with a Tools menu including "Command prompt window from current folder", which used to open a CMD window in the current folder but now makes a similar complaint about UNC paths not being supported. However, previously this behaviour would cease after I shut down my machine and restarted it again, after which UNC paths seemed to be supported again.. Now this no longer seems to happen, and Windows 10 still disallows UNC paths as the current folder, even after being restarted.
I would guess that this problem is the fault of my Microsoft Windows 10 operating environment, and not of StataCorp. And, if I do a Web search on
how-do-you-handle-cmd-does-not-support-unc-paths-as-current-directories
I get advice either to use commands called pushd and popd in my shell script or to use a Microsoft-distributed utility called PowerShell. This seems to suggest that opening a CMD window under Windows 10 to execute an ordinary CMD shell script in the current networked folder is no longer thought to be a reasonable thing to expect to be able to do. But have any other Stata users under Windows 10 encountered this problem when they try to use the shell command in a networked current folder with a UNC path? And is there a non-drastic workaround?
Best wishes
Roger
0 Response to Have any other users of Stata under Windows had problems with the shell command disallowing UNC paths?
Post a Comment