随笔分类 -  Batch

摘要:@echo off set input="list.txt" set srcDir="%1" set /a fileCount=10 set /a curIndex=0 set line= setlocal enabledelayedexpansion :: 创建一个空的文件 echo. 2> %input% for /f %%f in ('dir %srcDir%\*.jpg ... 阅读全文
posted @ 2017-02-09 21:45 silverbullet11 阅读(218) 评论(0) 推荐(0)
摘要:以下批处理脚本可以实现更改计算机名字的作用,具体作用是修改电脑属性中显示的名字更改DNS对应的记录,以便在网络上可以通过新的机器名进行访问@echo offset /p newName=Please input the new computer name:echo Modifying registry keys...::通过注册表修改本地机器名reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName /v ComputerName /d %newName% -freg 阅读全文
posted @ 2013-04-02 16:39 silverbullet11 阅读(1398) 评论(0) 推荐(0)
摘要:主要是借用"findstr /a <搜索内容> <文件>*"自定义输出样式的功能,默认情况运行结果如下:其中"E4"是对颜色设置的属性值,其他颜色的值如下 0 = 黑色 8 = 灰色 1 = 蓝色 9 = 淡蓝色 2 = 绿色 A = 淡绿色 3 = 浅绿色 B = 淡浅绿色 4 = 红色 C = 淡红色 5 = 紫色 D = 淡紫色 6 = 黄色 E = 淡黄色 7 = 白色 F = 亮白色实际应用中"a.txt"就是我们要彩显的内容,这样就需要我们在f... 阅读全文
posted @ 2013-03-02 22:35 silverbullet11 阅读(1320) 评论(0) 推荐(0)