Notepad3
Notepad3 copied to clipboard
Questions about file paths
@echo %cd%
@echo %~dp0
@pause>nul
Copy the above text in the test.bat file and place the test.bat file on a network disk (e.g. NAS). The network disk drive letter I mapped via Windows Explorer or Raidrive is the Z drive. For example, my path is “Z:\Download\test.bat”. But the path shown in notepad3 is “\\RaiDrive-Administrator\Synology\Download\test.bat”.
So, double-clicking on the bat file as well as running the document in the Notepad3 editor produces different paths.
For example, when I double-click on a bat file in File Explorer, this is what I get:
If you click on the “Execute Document” button in Notepad, the result will look like this:
I wonder if there is an option to display the path in two ways, one is to display the path shown by Explorer, i.e. “Z:\Download\test.bat”, and the other is to display the network path, i.e. “\RaiDrive-Administrator\Synology\Download\test.bat”.
That said, displaying the network path is not really useful, as it affects the result of the Execute Document.