1. 首页
  2. 数据库
  3. 其它
  4. bat批处理脚本 函数使用说明 函数调用结果如何返回

bat批处理脚本 函数使用说明 函数调用结果如何返回

上传者: 2021-01-09 16:03:26上传 PDF文件 32KB 热度 12次
BAT批处理脚本也可以使用函数,函数可以带参数,并且返回结果。但是批处理脚本的函数调用返回结果处理却不是很友好,处理起来相对麻烦。本文详细讲解函数定义、函数调用及调用结果如何返回。 1、代码案例 vfunc.bat @echo off echo sum1 a b, return with global variable. set a=10 set b=20 call :sum1 %a% %b% echo sum1(%a%,%b%)=%result1% echo= echo sum2 a b, return with argument. set a=10 set b=20 call :sum2
下载地址
用户评论