2014年3月21日

batch file echo line with 0 does not write to file 转载自:http://stackoverflow.com/questions/17779784/batch-file-echo-line-with-0-does-not-write-to-file

摘要: >>%wkdir%\some.ini ECHO ActionNumber=20Unfortunately, the space-after-digit solution echoes the space into the file, so you have trailing spaces.(That's a gotcha with any digit immediately preceding a redirector)share|improve this answeransweredJul 22 '13 at 4:21Magoo15.7k2723Wow- Now 阅读全文

posted @ 2014-03-21 18:30 wensky 阅读(164) 评论(0) 推荐(0)

自己写的一个用于往文件中插入字符串及空格的bat

摘要: @echo offecho pleas input the filename:set /p file=:whilerem set j=0 非得写这儿 写下面:check 上面不行 希望大神指点set j=0echo please input the content type:set /p type=if %type%==q ( goto END)echo please input the content:set /p input=if %type%==n (:checkif %j% lss %input% (type blank.txt>>%file%)set /a j+=1if 阅读全文

posted @ 2014-03-21 17:35 wensky 阅读(1052) 评论(0) 推荐(0)

在bat中 要小心 空格 转载自:http://zhidao.baidu.com/question/131888394.html

摘要: 问题就出在你的=上,批处理不像其它编程语言,其它编程语言在=两边有有没有空格的效果是一样的,但是批处理却不这样看,你前面的set value =%1就是把%1这个值给"value "这个变量,注意看空格,把它空格也作为变量名的一部分。你第二个批处理中,因为set aa =%date%而你在call的时候用%aa%来引用,这样是不对的,正确的应该用%aa %这样来引用。还是这个空格的问题。(ps:如果变量找不到 则输出 ECHO 处于关闭状态。)================================================================== 阅读全文

posted @ 2014-03-21 14:39 wensky 阅读(200) 评论(0) 推荐(0)

Exit 与 Goto :eof 在批处理中的区别 转载自:http://blog.sina.com.cn/s/blog_51a4af870100e0st.html

摘要: 在 CMD 命令提示符窗口直接运行:1.) 运行 Goto :eof 后,CMD 返回并将等待下一命令。2.) 运行 Exit 后,CMD 将直接关闭并返回到曾启动 Cmd.exe 的程序或返回到“资源管理器”。3.) 运行Exit /b 后,CMD 将直接关闭并返回到曾启动 Cmd.exe 的程序或返回到“资源管理器”。Exit退出当前批处理脚本或 Cmd.exe 程序(即,命令解释程序)并返回到曾启动 Cmd.exe 的程序或返回到“程序管理器”。语法exit[/b] [ExitCode]参数/b退出当前批处理脚本。ExitCode指定数字编号。/?在命令提示符显示帮助。注释如果在批处理脚 阅读全文

posted @ 2014-03-21 14:07 wensky 阅读(601) 评论(0) 推荐(0)

echo no newline 转载:http://stackoverflow.com/questions/7105433/windows-batch-echo-without-new-line

摘要: Using:echo | set /p=or<NUL set /p=will both work to suppress the newline.However, this can be very dangerous when writing more advanced scripts when checking the ERRORLEVEL becomes important as settingset /p=without specifying a variable name will set the ERRORLEVEL to 1.A better approach would b 阅读全文

posted @ 2014-03-21 13:49 wensky 阅读(467) 评论(0) 推荐(0)

script 网站

摘要: http://www.robvanderwoude.com/ 阅读全文

posted @ 2014-03-21 13:30 wensky 阅读(127) 评论(0) 推荐(0)

set 功能一览 转载:http://www.zhixing123.cn/computer/2154.html

摘要: set 功能一览[设置变量]格式:set 变量名=变量值详细:被设定的变量以%变量名%引用[取消变量]格式:set 变量名=详细:取消后的变量若被引用%变量名%将为空[展示变量]格式:set 变量名详细:展示以变量名开头的所有变量的值[列出所有可用的变量]格式:set[计算器]格式:set /a 表达式示例:set /a 1+2*3 输出 7[设置变量为表达式计算后的值]set a=1+2echo %a% ==>输出1+2------------------------------------set /a a=1+2echo %a% ==>输出3[设置变量为用户输入的值]set / 阅读全文

posted @ 2014-03-21 13:29 wensky 阅读(225) 评论(0) 推荐(0)

导航