首页 技术 正文
技术 2022年11月18日
0 收藏 927 点赞 3,766 浏览 1016 个字
rem echo off 表示之后所有命令行不显示,但命令结果总是会显示的!!  不存在%ROOT_DIR% 、 %CUR_DIR%的变量
rem @表示命令行不显示当前行,但命令结果总是会显示的!! ___ 对后面的行没影响! 参考 http://www.cnblogs.com/sgsoft/archive/2010/09/12/1824275.htmlhttp://www.cnblogs.com/freewl/archive/2008/11/02/1324805.html
@rem asffsaf
@echo
echo off
echo %ROOT_DIR%
cd ../linuxSocket
echo this is %%cd%% %cd%
echo this is %%~dp0 %~dp0
echo %CUR_DIR%dir
IF not ERRORLEVEL goto aa1
IF ERRORLEVEL goto aa2
:aa1
echo
:aa2
echo @echo off
rem (应先判断数值最高的错误码)
  choice /c dme /m defrag,mem,end[Default:men]  if errorlevel goto defrag   if errorlevel goto mem   if errorlevel goto end   :defrag
direcho copy xcp mkdir  C:\Users\LWX193~\Desktop\  goto end   :mem   mem   goto end   :end   echo good bye

一直有疑问的地方是 @ 的作用, echo off的作用, @echo off 这样的就更加糊涂了、、、

一些用法也老是忘记。。

errorlevel  
1 不区分大小写,
2 如果需要在echo引用的话,需要用%包起来:

C:\Users\lwx193682\Desktop\linuxSocket>echo errorlevel
errorlevel

C:\Users\lwx193682\Desktop\linuxSocket>echo %errorlevel%
1

如果在if中则不能再用%包起来,否则报错:

if errorlevel 0 echo 123      —— if errorlevel integer doSth 应该是一种语法,不可变更, windows会自动计算%errorlevel % , 如果变成%%errorlevel %%则出问题。。

%x% 应该有直接计算的意思吧

每个命令都有自己的errorlevel

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,075
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,551
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,399
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,176
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,811
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,893