〔已解决〕怎样通过读取INI配置文件来删除呢
本帖最后由 abcd1258 于 2015-11-4 09:26 编辑1234.INI
Delete1=C:\1.exe
Delete2=C:\2.exe
Delete3=C:\3.exe
Delete4=C:\4.exe
Delete5=C:\5.exe FileRead ( "文件句柄/文件名" [, 数量] )
前辈。看能帮到您不。。。 IniRead ( "文件名", "字段名", "关键字", "默认值" )
还有这个 $r = IniRead(@WindowsDir & "\1234.ini","Delete", "Delete1","")
If FileDelete($r) > 0 Then
FileDelete($r)
EndIf
$r = IniRead(@WindowsDir & "\1234.ini","Delete", "Delete2","")
If FileDelete($r) > 0 Then
FileDelete($r)
EndIf
这样也可以的,但不想添加一个加上一行代码,这样比较麻烦。 不要让帖子沉下去。 #RequireAdmin
$var = IniReadSection("d:\1234.ini", "Delete")
if @error Then
Msgbox(4096,"","读取错误")
else
for $i=1 to $var
$filePath = StringReplace($var[$i],Chr(34),"")
if FileExists($filePath) Then
ConsoleWrite("path-->"& $filePath &" 删除结果:"& FileDelete($filePath) &@CR)
Else
ConsoleWrite("The file is no exist." &@CR)
EndIf
next
EndIf 回复 6# user030
谢谢,按照你的方法,已解决 学习来了,先试试 ini文件,我借鉴一下
页:
[1]