bat切换当前目录

Monday, Jun 20, 2016 | 1 minute read | Updated at Monday, Jun 20, 2016

@
bat切换当前目录
@echo off
cd %~dp0
call git pull
xcopy D:\google\hosts\hosts C:\Windows\System32\drivers\etc\ /Y /R

每次更新host,使用管理员运行显示git失败,原因是使用管理员运行时,目录切换到system32下了。 cd %~dp0表示切换回当前目录

© 2016 - 2025 Caisong's Blog

🌱 Powered by Hugo with theme Dream.

About Me

大龄程序员,喜欢折腾各种环境部署、软件应用。

博客记录日常。