Dim WshSHell,FSO
On Error Resume Next
Set WshSHell = WScript.Createobject("WScript.Shell")
Set FSO = Createobject("Scripting.Filesystemobject")
Set WinVer = WshSHell.Environment("Process")
Set Args = WScript.Arguments
CloseTime = 5
FileName = WScript.ScriptName
FileFullName = WScript.ScriptFullName
FilePath = FSO.GetParentFolderName(FileFullName)
InsPath = FSO.GetSpecialFolder(1)
InsFullName = FSO.BuildPath(InsPath ,FileName)
LnkPathNT = WshSHell.SpecialFolders(2)
LnkPath9X = WshSHell.SpecialFolders(14)
LnkPathAll = WshSHell.SpecialFolders("StartMenu")
OtherFileName="PathCopyEx.dll"
OtherFilePath=FSO.GetSpecialFolder(1)
TemFileName = ""
TemFilePath = FSO.GetSpecialFolder(1)
Copyright="玲珑科技"
QQ="QQ:25926183"
Email="Email:fty1995@163"
InsTitle="添加/删除快捷方式字样和箭头"
InsAnswer="添加/删除快捷方式字样和箭头"
RegPath0="HKEY_CLASSES_ROOT\lnkfile\shell\"
RegValue0="open"
RegForm0="REG_SZ"
RegPath1="HKEY_CLASSES_ROOT\lnkfile\shell\Del_Shortcut_ICO-Name\"
RegValue1="添加/取消快捷方式字样和箭头"
RegForm1="REG_SZ"
RegPath2="HKEY_CLASSES_ROOT\lnkfile\shell\Del_Shortcut_ICO-Name\command\"
RegValue2=" "&InsFullName
RegForm2="REG_SZ"
MyShortcutFolder="快捷功能"
MyShortcutName="添加/取消快捷方式字样和箭头.Lnk"
If FileFullName <> InsFullName Then
intAnswer = Msgbox("【是】将“"+ InsAnswer +"”加入到右键菜单,"&Chr(10)&Chr(10)&"【否】将“"+ InsAnswer +"”从右键菜单删除。 ", vbQuestion + vbYesNoCancel, "安装 - "+ InsTitle +" - "+ Copyright)
If intAnswer = vbYes Then
WshSHell.RegWrite RegPath0,RegValue0,RegForm0
WshSHell.RegWrite RegPath1,RegValue1,RegForm1
WshSHell.RegWrite RegPath2,RegValue2,RegForm2
FSO.GetFile(FileFullName).Copy(InsFullName)
If WshSHell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Link")
<> "0" Then
WshSHell.RegWrite RegPath1, "取消快捷方式字样和箭头", "REG_SZ"
Else
WshSHell.RegWrite RegPath1, "添加快捷方式字样和箭头", "REG_SZ"
End If
WshSHell.popup _
"添加脚本文件:"+Chr(10)+InsFullName+Chr(10)+Chr(10)+ _
"添加注册表项:"+Chr(10)+Chr(34)+ RegPath1 +Chr(34)+Chr(10)+ _
Chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +Chr(10)+Chr(10)+ _
Chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "安装成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
End If
If intAnswer = vbNo Then
WshSHell.RegDelete RegPath2
WshSHell.RegDelete RegPath1
FSO.DeleteFile InsFullName
WshSHell.popup _
"删除脚本文件:"+Chr(10)+InsFullName+Chr(10)+Chr(10)+ _
"删除注册表项:"+Chr(10)+Chr(34)+ RegPath1 +Chr(34)+Chr(10)+ _
Chr(10) & CloseTime & " 秒钟后本窗口将自动关闭!" +Chr(10)+Chr(10)+ _
Chr(10) & "Copyright(C) " + Copyright +" " & QQ &" " + Email _
, CloseTime, "卸载成功 - "+ InsTitle +" - "+ Copyright, 0 + 64
End If
If intAnswe
r = vbCancel Then
End If
Else
If WshSHell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Link") <> "0" Then
WshSHell.RegDelete "HKEY_CLASSES_ROOT\lnkfile\IsShortcut"
WshSHell.RegDelete "HKEY_CLASSES_ROOT\piffile\IsShortcut"
WshSHell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Link",0,"REG_DWORD"
WshSHell.RegWrite RegPath1, "添加快捷方式字样和箭头", "REG_SZ"
Else
WshSHell.RegWrite "HKEY_CLASSES_ROOT\lnkfile\IsShortcut","","REG_SZ"
WshSHell.RegWrite "HKEY_CLASSES_ROOT\piffile\IsShortcut","","REG_SZ"
WshSHell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Link",1,"REG_DWORD"
WshSHell.RegWrite RegPath1, "取消快捷方式字样和箭头", "REG_SZ"
End If
If WinVer("OS") <> "Windows_NT" Then
WshSHell.Run ("RUNDLL32 SHELL32.DLL,SHExitWindowsEx -1"), vbHide
Else
For Each Process In Getobject("winmgmts:"). _
ExecQuery ("Select * from Win32_Process where name=''")
Next
WScript.Sleep 3000
For Each ps In Getobject _
("winmgmts:\\.\root\cimv2:win32_process").instances_
If Lcase(ps.name)="" Then
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
vbs脚本怎么停止Exit For
End If
Next
WshSHell.Run ("")
End If
End If
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论