回复 7# Tianorder
计划任务的问题,2楼已经说明过了。如果你不会绝对路径,可以参考下面的“相对路径”:- Option Explicit
-
- Dim wso, fso, strText, strLine, arrDest(), i
- Set wso = CreateObject("WScript.Shell")
- Set fso = CreateObject("Scripting.FileSystemObject")
-
- '指定当前路径
- wso.CurrentDirectory = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\") -1)
-
- strText = fso.OpenTextFile("config.ini", 1, True).ReadAll
-
- i = 0
- For Each strLine In Split(strText, vbCrLf)
- If Left(strLine, 1) <> ";" And Left(strLine, 1) <> "[" And strLine <> "" Then
- ReDim Preserve arrDest(i)
- arrDest(i) = strLine
- i = i + 1
- End if
- Next
-
- Msgbox Join(arrDest, vbCrLf)
复制代码
|