Skip to content

【批处理使用技巧】

链接文件夹

例如把当前目录下的\bin\resource目录反射成指定的目录:

text
mklink /J %~dp0\bin\resource ..\..\..\art\trunk\bin\resource

设置当前文件夹为执行目录

text
pushd %~dp0
:: 比如执行当前目录下的test.js文件----
node test.js
popd

使用变量

text
set rootPath=G:\work\yuanzun\client\
cd /d %rootPath%\trunk
:: do some thing like this npm run start
pause

图片文件加文本

text
copy d:picname.jpg/b + d:txtname.txt/a d:jieguotu.jpg

MIT Licensed