I am seeing a difference in behaviour on the default directory when you execute cmd.exe when you are already inside a shell between Win7 and Win10.
Windows 7:
C:\projects\test>ver
Microsoft Windows [Version 6.1.7601]
C:\projects\test>cmd.exe
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\projects\test>exit
C:\projects\test>
Windows 10:
C:\projects\test>ver
Microsoft Windows [Version 10.0.18363.1316]
C:\projects\test>cmd.exe
Microsoft Windows [Version 10.0.18363.1316]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\john>exit
C:\projects\test>
The problem I am facing is that, this difference in behaviour is causing some 3rd-party scripts to fail, as it assumed that when cmd.exe is executed, it was running in whatever was the default directory instead of the user's home directory or C:\Users\xxxx
For example:
yarn install
when the directory contains a package.json that has a dependency on phantomjs-prebuilt. It ends up looking forinstall.js
inC:\Users\xxxx
instead of in thenode_modules\karma-phantomjs-launcher\node_modules\phantomjs_prebuilt
directory.
- Maven's maven-javadoc-plugin when executing the jar goal dynamically creates a
javadoc.bat
and that BAT file specifically callscmd.exe
to execute javadoc. Essentially, the javadoc execution from the maven build fails in Windows10 due to this behaviour.