6,850
社区成员
发帖
与我相关
我的任务
分享
[360]
Found=All
Name=___C%3A%5CProgram%20Files%5Carswp3%5CArSwp3.exe___
Tel=<<<>>>
[InternetShortcut]
URL=http://www.baidu.com
IconIndex=0
IconFile=C:\Program Files\arswp3\ArSwp3.exe
strPathName = "C:\TEST"
TranverseFile(strPathName)
Function ReadIni( myFilePath, mySection, myKey )
' This function returns a value read from an INI file
'
' Arguments:
' myFilePath [string] the (path and) file name of the INI file
' mySection [string] the section in the INI file to be searched
' myKey [string] the key whose value is to be returned
'
' Returns:
' the [string] value for the specified key in the specified section
'
' CAVEAT: Will return a space if key exists but value is blank
'
' Written by Keith Lacelle
' Modified by Denis St-Pierre and Rob van der Woude
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Dim intEqualPos
Dim objFSO, objIniFile
Dim strFilePath, strKey, strLeftString, strLine, strSection
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
ReadIni = ""
strFilePath = Trim( myFilePath )
strSection = Trim( mySection )
strKey = Trim( myKey )
If objFSO.FileExists( strFilePath ) Then
Set objIniFile = objFSO.OpenTextFile( strFilePath, ForReading, False )
Do While objIniFile.AtEndOfStream = False
strLine = Trim( objIniFile.ReadLine )
' Check if section is found in the current line
If LCase( strLine ) = "[" & LCase( strSection ) & "]" Then
strLine = Trim( objIniFile.ReadLine )
' Parse lines until the next section is reached
Do While Left( strLine, 1 ) <> "["
' Find position of equal sign in the line
intEqualPos = InStr( 1, strLine, "=", 1 )
If intEqualPos > 0 Then
strLeftString = Trim( Left( strLine, intEqualPos - 1 ) )
' Check if item is found in the current line
If LCase( strLeftString ) = LCase( strKey ) Then
ReadIni = Trim( Mid( strLine, intEqualPos + 1 ) )
' In case the item exists but value is blank
If ReadIni = "" Then
ReadIni = " "
End If
' Abort loop when item is found
Exit Do
End If
End If
' Abort if the end of the INI file is reached
If objIniFile.AtEndOfStream Then Exit Do
' Continue with next line
strLine = Trim( objIniFile.ReadLine )
Loop
Exit Do
End If
Loop
objIniFile.Close
Else
WScript.Echo strFilePath & " doesn't exists. Exiting..."
Wscript.Quit 1
End If
End Function
Function URLDecode(strURL)
Dim I
If InStr(strURL, "%") = 0 Then
URLDecode = strURL
Exit Function
End If
For I = 1 To Len(strURL)
If Mid(strURL, I, 1) = "%" Then
If Eval("&H" & Mid(strURL, I + 1, 2)) > 127 Then
URLDecode = URLDecode & Chr(Eval("&H" & Mid(strURL, I + 1, 2) & Mid(strURL, I + 4, 2)))
I = I + 5
Else
URLDecode = URLDecode & Chr(Eval("&H" & Mid(strURL, I + 1, 2)))
I = I + 2
End If
Else
URLDecode = URLDecode & Mid(strURL, I, 1)
End If
Next
End Function
Function CJ(FPath)
Dim A1,A2,A3(3)
A1 = Split(FPath,"\")
A3(0) = Left(FPath,Len(FPath)-1-Len(A1(UBound(A1))))
A3(1) = A1(UBound(A1))
A2 = Split(A3(1),".")
A3(2) = Left(A3(1),Len(A3(1))-1-Len(A2(UBound(A2))))
CJ = A3
End Function
Function TranverseFile(strPathName)
Set oFSO = CreateObject("scripting.filesystemobject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oFolder = oFSO.GetFolder(strPathName)
Set oFiles = oFolder.Files
Dim FPath,OBJ1,OBJ2
For Each oFile In oFiles
If StrComp(LCase(oFSO.GetExtensionName(oFile)),"yfiye")=0 Then
FPath = ReadIni(oFile.Path,"360","Name")
IconIndex = ReadIni(oFile.Path,"InternetShortcut","IconIndex")
IconFile = ReadIni(oFile.Path,"InternetShortcut","IconFile")
FPath = URLDecode(FPath)
FPath = Mid(FPath,4,Len(FPath)-6)
OBJ1 = CJ(OFile.Path)
OBJ2 = CJ(FPath)
Set oShellLink = WshShell.CreateShortcut( OBJ1(0) & "\" & OBJ1(2) & ".lnk")
oShellLink.TargetPath = FPath
oShellLink.IconLocation = IconFile & "," & IconIndex
oShellLink.WorkingDirectory = OBJ2(0)
oShellLink.Save
End If
Next
Set oSubFolders = oFolder.subfolders
'Recurse the subFolder
For Each oSubFolder In oSubFolders
TranverseFile(oSubFolder)
Next
Set oFSO = Nothing
Set oFolder = Nothing
Set oSubFolder = Nothing
Set oSubFolders = Nothing
Set oFiles = Nothing
Set oFile = Nothing
End Function
[360]
Found=All
Name=___C%3A%5CProgram%20Files%5CMozilla%20Firefox%5Cfirefox.exe___
Tel=<<<>>>
[InternetShortcut]
URL=http://www.baidu.com
IconIndex=0
IconFile=C:\Program Files\Mozilla Firefox\firefox.exe
L F 掶%??+舠? 掶%??hU/ P郞??i⒇ +00? /C:\ J 1 ?g PROGRA~1 2 锞???g P r o g r a m F i l e s J 1 ?b SOGOUE~1 2 锞?<t?b S o g o u E x p l o r e r V 2 hU/ ?糔 SOGOUE~1.EXE : 锞?糔?@t S o g o u E x p l o r e r . e x e _ - ^ }6 C:\Program Files\SogouExplorer\SogouExplorer.exe 6 . . \ . . \ . . \ P r o g r a m F i l e s \ S o g o u E x p l o r e r \ S o g o u E x p l o r e r . e x e C : \ P r o g r a m F i l e s \ S o g o u E x p l o r e r ? w ` 燲 pc-200907121231 p兟垸?Hゅ摉儵踼撵漋^嬤 ??p兟垸?Hゅ摉儵踼撵漋^嬤 ??