Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
批处理文件如何单独查看它的位置?
%0 是文件名。%~dp0 将是文件的绝对位置,其中 d 是驱动器,p 是路径,0 是文件名。
只需调用“cd”
set WORKING_DIRECTORY=%cd%
曾经是 %~dp0,但这在 Vista 中对我不起作用。