惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - mumuliang

php.ini 开发和线上配置的差异 [laravel]malformed header from script 'index.php': Bad header: HTTP/1.1 302 Found, referer: http://localhost/auth/login 4e00~9fa5 [todo] 3rd [笔记] 为了不让移动端页面分权重你应当如何做? 一样的alert代码,样式不同 Eclipse中Sever启动成功,但tomcat无法管理页面无法访问。 Process的Waitfor() 引起代码死锁 [转载]Eclipse调试Java的10个技巧 写了一阵儿西夏普以后回头写西加加你会想不起来的那些事儿 为毛无法创建文本文件COM1.txt PADS在注册表中的菜单栏数据 C# Marshal.GetActiveObject() 遭遇 HRESULT:0x800401E3 (MK_E_UNAVAILABLE)) AutoVue打开ProE工程图中文乱码 Visual studio智能感知挡住了当前代码输入行 创建COM对象时遭遇 800702e4 以Administrator权限运行VS时无法拖入文件 如何判断exe或dll的目标平台及是否是.NET? 调用约定__cdecl和__stdcall
批处理设置当前路径为工作路径
mumuliang · 2014-10-27 · via 博客园 - mumuliang

win8里,直接双击执行bat,当前路径就是当前路径,但没有管理员权限;右键以管理员权限运行bat,当前路径貌似会跑到path(或system?笔者瞎猜),总之不是bat文件所在路径。

因此找了一小段代码用来保证bat右键以管理员运行时工作路径位于该bat文件的位置。如下:

 set base_dir=%~dp0  
 %base_dir:~0,2%
 pushd %base_dir% 

 没什么别的,就是想说,其实只需要如下一句:

pushd %~dp0