Winclip version
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 = "winclip.exe"
OtherFilePath = FSO.GetSpecialFolder(1)
TemFileName = "Untitled"
TemFilePath = FSO.GetSpecialFolder(2)
Copyright = "Linglong Technology"
QQ = "QQ:25926183"
Email = "Email:fty1995@163.com"
InsTitle = "Copy Path to Clipboard - Winclip Version"
InsAnswer = "Copy Path to Clipboard"
RegPath1 = "HKEY_CLASSES_ROOT\*\shell\PathCopyEx_Winclip\"
RegValue1 = "Copy Path to Clipboard"
RegForm1 = "REG_SZ"
RegPath2 = "HKEY_CLASSES_ROOT\*\shell\PathCopyEx_Winclip\command\"
RegValue2 = "wscript.exe " & Chr(34) & InsFullName & Chr(34) & " " & Chr(34) & "%L" & Chr(34)
RegForm2 = "REG_SZ"
RegPath3 = "HKEY_CLASSES_ROOT\Directory\shell\PathCopyEx_Winclip\"
RegValue3 = "Copy Path to Clipboard"
RegForm3 = "REG_SZ"
RegPath4 = "HKEY_CLASSES_ROOT\Directory\shell\PathCopyEx_Winclip\command\"
RegValue4 = "wscript.exe " & Chr(34) & InsFullName & Chr(34) & " " & Chr(34) & "%L" & Chr(34)
RegForm4 = "REG_SZ"
RegPath9 = "HKEY_CLASSES_ROOT\Drive\shell\"
RegPath10 = "HKEY_CLASSES_ROOT\Directory\shell\"
RegValue13 = "open"
WshSHell.RegWrite RegPath9, RegValue13, RegForm1
WshSHell.RegWrite RegPath10, RegValue13, RegForm1
IF FileFullName <> InsFullName Then
intAnswer = MsgBox("【Yes】Add " & Chr(34) & InsAnswer & Chr(34) & " to the right-click menu," & Chr(10) & Chr(10) & "【No】Remove " & Chr(34) & InsAnswer & Chr(34) & " from the right-click menu. ", vbQuestion + vbYesNoCancel, "Installation - " & InsTitle & " - " & Copyright)
If intAnswer = vbYes Then
WshSHell.RegWrite RegPath1, RegValue1, RegForm1
WshSHell.RegWrite RegPath2, RegValue2, RegForm2
WshSHell.RegWrite RegPath3, RegValue3, RegForm3
WshSHell.RegWrite RegPath4, RegValue4, RegForm4
FSO.GetFile(FileFullName).Copy(InsFullName)
If (FSO.FileExists(FSO.BuildPath(FilePath, "winclip.llkj"))) Then
FSO.GetFile(FSO.BuildPath(FilePath, "winclip.llkj")).Copy(FSO.BuildPath(OtherFilePath, OtherFileName))
Else
Call alltovbs
End If
FSO.GetFile(FSO.BuildPath(FilePath, "winclip.llkj")).Copy(FSO.BuildPath(OtherFilePath, OtherFileName))
WshSHell.popup _
"Add script file:" & Chr(10) & InsFullName & Chr(10) & Chr(10) & _
"Add executable file:" & Chr(10) & FSO.BuildPath(OtherFilePath, OtherFileName) & Chr(10) & Chr(10) & _
"Add registry entry:" & Chr(10) & Chr(34) & RegPath1 & Chr(34) & Chr(10) & Chr(34) & RegPath3 & Chr(34) & Chr(10) & _
Chr(10) & CloseTime & " seconds later this window will close automatically!" & Chr(10) & Chr(10) & _
Chr(10) & "Copyright(C) " & Copyright & " " & QQ & " " & Email _
, CloseTime, "Installation Succeeded - " & InsTitle & " - " & Copyright, 0 + 64
End If
If intAnswer = vbNo Then
WshSHell.RegDelete RegPath4
WshSHell.RegDelete RegPath3
WshSHell.RegDelete RegPath2
WshSHell.RegDelete RegPath1
FSO.DeleteFile InsFullName
FSO.DeleteFile FSO.BuildPath(OtherFilePath, OtherFileName)
WshSHell.popup _
"Remove script file:" & Chr(10) & InsFullName & Chr(10) & Chr(10) & _
"Remove executable file:" & Chr(10) & FSO.BuildPath(OtherFilePath, OtherFileName) & Chr(10) & Chr(10) & _
"Remove registry entry:" & Chr(10) & Chr(34) & RegPath1 & Chr(34) & Chr(10) & Chr(34) & RegPath3 & Chr(34) & Chr(10) & _
Chr(10) & CloseTime & " seconds later this window will close automatically!" & Chr(10) & Chr(10) & _
Chr(10) & "Copyright(C) " & Copyright & " " & QQ & " " & Email _
, CloseTime, "Uninstallation Succeeded - " & InsTitle & " - " & Copyright, 0 + 64
End If
If intAnswer = vbCancel Then
End If
ELSE
If (FSO.FileExists(FSO.BuildPath(OtherFilePath, OtherFileName))) Then
Set TempFile = FSO.CreateTextFile(FSO.BuildPath(TemFilePath, TemFileName), True)
TempFile.WriteLine(Args(0))
TempFile.Close
WshSHell.Run (FSO.BuildPath(OtherFilePath, OtherFileName) & " -c " & FSO.BuildPath(TemFilePath, TemFileName)), vbHide
Else
WshSHell.popup + Chr(10) & _
"Operation failed!" & Chr(10) & Chr(10) & _
"Your system is missing the file "Winclip.exe", so your operation request failed." & Chr(10) & Chr(10) & _
"We are very sorry, re-executing the installation program may solve this problem." & _
Chr(10) & Chr(10) & CloseTime & " seconds later this window will close automatically!" & Chr(10) & Chr(10) & _
Chr(10) & "Copyright(C) " & Copyright & " " & QQ & " " & Email _
, CloseTime, "Operation Failed - " & InsTitle & " - " & Copyright, 0 + 48
End If
End IF
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
sub alltovbs()
'Generate Winclip.exe by yourself
end sub