修改ini文件的批处理
用VBS更简单:
vbs代码: On Error Resume Next
Dim Fso,TxtFl,Str
Set Fso = CreateObject("Scripting.FileSystemObject")
Set TxtFl = Fso.OpenTextFile ("文件位置",)
Str = Replace ( TxtFl.ReadAll,"被替换内容","替换内容")
Set TxtFl = Fso.OpenTextFile ("文件位置",)
TxtFl.Write Str
TxtFl.Close 批处理代码: @echo off >tmp.ini
for /f "tokens=1* delims=:" %%i in ('findstr /n ".*" 文件位置') do (
if "%%j"=="" (echo.>>tmp.ini) else (
echo %%j|find "被替换内容">nul&&(
call set tp=%%j&call echo %%tp:被替换内容=替换内容%%>>tmp.ini)||(
>>tmp.ini echo %%j)
)
)
copy tmp.ini 文件位置 /y >nul||(attrib -s -a -r -h 文件位置& copy tmp.ini 文件位置 /y >nul)
del tmp.ini
pause
批处理打开和关闭文件
关闭 两种命令方法: taskkill /f im "要关闭的进程名" ntsd -c q -pn "要关闭进程名" 后者更强一点..~! 打开程序: start "" “位置/程序名”
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASEAAABbCAIAAACzsaRfAAAULElEQVR4nO1d7XPURp7WH3BXl4982srcpu7KtR+OVM0l4OPukqnbuo0rd7XMXm1VXDu3SVRrMFOVbBA4hgFijICQiApJlCUBLRDITPYA2QYi7+USEZI1ypCwSoIdGXtsGRtjGY9t4de2eYnuQ89oNHrp0dgemzX91FPUTM+vH3X/9HvULdkeiGs3pjAxMUtHondgGhMTs3Qkmj+9jImJWToStzAwMEoJ4ocfDExMzNKRGB4ZvTmULpbDI6OTU9N37/2AiYmJJgFm7ty+c69Ygpk76WF9bHxy9vY9zPuc+/a9fufuD0s+jAd2mgSYvTs9c3d65q7sDVVVYYxJMHt3CtweGBy2tVvJSTorapAb48rGuLKRk5m4hOhy7Ngx+K9PIKTmT03TisqJk6qqSg746eieT0GiODnMSCYrGCnGofIJuffV12Zv3/N/oGJzu7BnhyMDeYyW+exY7DQXjcT41O3xqduyLBvegJUBI01OgjvXrmu2RitZUTMMQ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pVbInKHaI7kj9zqKOdF2jLm5ojbUpAfg6TTY8kDwUKaxV4+vOKL0HG7FriOLRGxnKDkgSByKbtPPRYhDEuu82xTcP2pDxrB+txb012J/P1hEetY8kAQ+iRRBWvUTLfXtXPQYx3zik9EcluOZH05QfjymLN68loSVfnbmCI8Zr1Ouy44XsbzW7uJqmCkKnu1sU622bzU+Nzj5brY473aixmnx3ztHkMe4j71WH3Qc5Fx90Yib11yesxZWMV5DCYxW7WWS5qlJvIL0WOv6BpfTL3mSbmVfrbR92LoXlvW+xn7XMyLzlxrF4pnGq01mqiyXFur/I4/c0Ld7/q82n3mwXW+y8Fj2Zm4bP9cvJE0gpZ1z2Udc/PSAnks7wwVXMc84ufiMcTWKLPk+ntmgKqtDPOG53+ZRegn68vzc5URzKvdAqMqME4f7b7y4DrfvHuwv9C9YtC68iTyFiLrfi9jJ2tAwm0dc/OSi45Xmrw9lrdW5Jd17qPsDhMRn3+t9fM4AfE4sTnifkdXzF7Ro55s++H56NcHidxewLIvtT5XyO/lom8Rydtve7UXO07P+SYPRCx7/pI/84AP7nN466MF8Zh172crl4jj8UZuxYtk95nQPwn3DaSXjms2g+Yj2kQV3OHArU4kYXmA4Txtbg+mEfHWj/w8r0PfnbstYi61lYgQebDs2SyjyUohn+UUp5+Lt+l47r09vOF1/4a4r/M9Tp/Prhbh2f3CAv8M2gebI8Xu1jCXjthjmJilJfYYJmZpiT2GiVla3o8ew8BYTsAew8AoLbDHMDBKC+wxDIzSAnsMA6O0wB7DwCgtsMcwMEoL7DEMjNICewwDo7TAHsPAKC2wxzAwSgvsMQyM0gJ7DAOjtMAew8AoLbDHMDBKC+wxDIzSAnsMA6O0wB7DwCgt/h9Ja9ZxjF2AkwAAAABJRU5ErkJggg==" alt="" />
修改ini文件的批处理的更多相关文章
- shell读取或者修改ini文件
cfg_find(){ file_name=$1 labelname=$2 key=$3 labelline=$(grep -n "^\[.*\]$" $file_name | a ...
- WIN32读写INI文件方法
在程序中经常要用到设置或者其他少量数据的存盘,以便程序在下一次执行的时候可以使用,比如说保存本次程序执行时窗口的位置.大小.一些用户设置的 数据等等,在 Dos 下编程的时候,我们一般自己产生一个 ...
- 在 WinCe 平台读写 ini 文件
在上篇文章开发 windows mobile 上的今日插件时,我发现 wince 平台上不支持例如 GetPrivateProfileString 等相关 API 函数.在网络上我并没有找到令我满意的 ...
- C#中读写INI文件
INI文件就是扩展名为“ini”的文件.在Windows系统中,INI文件是很多,最重要的就是“System.ini”.“System32.ini”和“Win.ini”.该文件主要存放用户所做的选择以 ...
- 如何在C#中读写INI文件
INI文件就是扩展名为"ini"的文件.在Windows系统中,INI文件是很多,最重要的就是"System.ini"."System32.ini&q ...
- C#读写.ini文件
转载来源: http://blog.csdn.net/source0573/article/details/49668079 https://www.cnblogs.com/wang726zq/arc ...
- C# 如何实现完整的INI文件读写类
作者: 魔法软糖 日期: 2020-02-27 引言 ************************************* .ini 文件是Initialization File的缩写,即配置文 ...
- INI文件,WritePrivateProfileString()和GetPrivateProfileString()函数----转载
INI文件就是扩展名为“ini”的文件.在Windows系统中,INI文件是很多,最重要的就是“System.ini”.“System32.ini”和“Win.ini”.该文件主要存放用户所做的选择以 ...
- DOS 批处理 修改xml文件
之前对批处理和dos只停留在cd ping ipconfig水平,我以为改个文件应该很简单吧,把文件读出来做个替换再写回去不就欧了,百度个例子改改,那还不是分分钟的事,哪知道事实比想的要复杂的多. 我 ...
随机推荐
- linux 常用的中文手册
http://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html 总结的非常好!包括基础.进阶以及各种常用工具.
- Statically Linking freeglut
It’s possible statically link freeglut into your applications, instead of dynamically linking agains ...
- 请求头缺少 'Access-Control-Allow-Origin'
报错: 火狐上运行,出现报错信息.已拦截跨源请求:同源策略禁止读取位于 https://xxxxxxx 的远程资源.(原因:CORS 头缺少 'Access-Control-Allow-Origin' ...
- 004_strace工具
strace - trace system calls and signals 一.strace工具详解 之前线上主机上8351 进程夯死导致无法获悉进程信息,监控程序使用ps 命令查看进程信息至/p ...
- 监听本机tcp和udp的端口
#!/bin/bash #tcp part port1=`netstat -an|grep LISTEN|egrep "0.0.0.0|:::"|awk '/^tcp/ {prin ...
- hive学习03-求一年中的最大温度
知识点: substr.concat函数的使用: row_number() over(distribute by year sort by temp desc) #按照年分组,按照tmp去排序 需 ...
- PID控制器开发笔记之二:积分分离PID控制器的实现
前面的文章中,我们已经讲述了PID控制器的实现,包括位置型PID控制器和增量型PID控制器.但这个实现只是最基本的实现,并没有考虑任何的干扰情况.在本节及后续的一些章节,我们就来讨论一下经典PID控制 ...
- Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project Resource: Cannot invoke Tomcat manager: Connection refused: connect -> [Help 1]
1.问题描述 在 DOS 下执行 tomcat7-maven-plugin 插件部署,启动 Apache Tomcat 服务报错如下: D:\2018\code\XXX>mvn tomcat7: ...
- ssh 登录报错 packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
问题 更新个人博客文章时遇到:Error: packet_write_wait: Connection to 192.30.253.113 port 22: Broken pipe packet_wr ...
- django rest framework(3)
目录 一.版本 二.解析器 三.序列化 四.请求数据验证 一.版本 程序也来越大时,可能通过版本不同做不同的处理 没用rest_framework之前,我们可以通过以下这样的方式去获取. class ...