
@echo off
cd %~dp0
call git pull
xcopy D:\google\hosts\hosts C:\Windows\System32\drivers\etc\ /Y /R
每次更新host,使用管理员运行显示git失败,原因是使用管理员运行时,目录切换到system32下了。
cd %~dp0
表示切换回当前目录
Monday, Jun 20, 2016 | 1 minute read | Updated at Monday, Jun 20, 2016
@echo off
cd %~dp0
call git pull
xcopy D:\google\hosts\hosts C:\Windows\System32\drivers\etc\ /Y /R
每次更新host,使用管理员运行显示git失败,原因是使用管理员运行时,目录切换到system32下了。
cd %~dp0
表示切换回当前目录
大龄程序员,喜欢折腾各种环境部署、软件应用。
博客记录日常。