China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-04 06:18
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Copy path to clipboard → VBS version View 2,979 Replies 15
Original Poster Posted 2007-03-18 10:46 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
I forgot where I got the PathCopyEx.DLL file. After registration, there will be an additional item "Copy Path to Clipboard" in the right-click menu. It is indeed very convenient and quick in daily path copying operations. Later, I imitated 4 other versions of "Copy Path to Clipboard" with the same function.

①Original PathCopyEx_DLL. As long as PathCopyEx.DLL is registered, the right-click menu will appear.
http://zhenlove.com.cn/cndos/fileup/files/PathCopyEx_DLL.rar

②PathCopyEx_Excel.rar, imitated version. The disadvantage is that it requires EXCEL support.
http://zhenlove.com.cn/cndos/fileup/files/PathCopyEx_Excel.rar

③PathCopyEx_IE.rar, imitated version. The disadvantage is that it requires IE support.
http://zhenlove.com.cn/cndos/fileup/files/PathCopyEx_IE.rar

④PathCopyEx_Notepad.rar, imitated version. The advantage is that no additional support programs need to be installed. Only Notepad function and wscript are needed, which are both system-built-in and installed by default. The disadvantage is that a Notepad window flashes during the operation.
http://zhenlove.com.cn/cndos/fileup/files/PathCopyEx_Notepad.rar

⑤PathCopyEx_Winclip.rar, imitated version. The disadvantage is that it requires third-party Winclip support.
http://zhenlove.com.cn/cndos/fileup/files/PathCopyEx_Winclip.rar




[ Last edited by baomaboy on 2007-3-18 at 10:50 AM ]
Floor 2 Posted 2007-03-18 12:39 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Still the IE version is the most enjoyable. I've always used it.

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 3 Posted 2007-03-18 12:48 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Originally posted by electronixtar at 2007-3-18 12:39:
The IE version is the most enjoyable. I've been using it all the time.


Brother electronixtar, have you ever encountered this situation when using the IE version?

I have installed Maxthon and set it as the default. When I have a Maxthon window open and then run the copy path in the IE version, it will open a blank Maxthon window (about:blank). Each run opens one, which is really frustrating.
Floor 4 Posted 2007-03-18 12:51 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Originally posted by baomaboy at 2007-3-18 12:48:


Have you ever encountered this situation with the IE version, Brother electronixtar?

When I have Maxthon installed and it's the default, when I run the IE version to copy the path while the Maxthon window is open, it will open a blank Maxthon window (about:blank). One run opens one, which is really annoying.


Of course, I have encountered it. Solutions:
1. Modify the configuration file of MT.

2. Use other objects. But there is currently no mature method for the time being. If you are interested, you can search the forum for "htmlfile" and "about:blank" in full text.

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 5 Posted 2007-03-18 12:54 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Originally posted by electronixtar at 2007-3-18 12:51:

Of course I encountered it. Solutions:
1. Modify the configuration file of MT.

2. Use other objects. But there is currently no mature method for the time being. Brother, if you are interested, you can search the forum for "htmlfile" and "about:blank" throughout the text


I see there were already solutions. Thank you, brother.
Floor 6 Posted 2007-03-18 12:56 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
I can't download the file, post an IE version for me to see
Floor 7 Posted 2007-03-18 12:59 ·  中国 四川 成都 联通
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
http://www.cn-dos.net/forum/viewthread.php?tid=24064

http://www.cn-dos.net/forum/viewthread.php?tid=22649

http://www.cn-dos.net/forum/viewthread.php?tid=20933


Also, you can join this group: 34021244. There are all extremely powerful people in it. Among them, 9527's WMI and ADSI have reached a profound level. We should learn a lot from him about VBS. 9527 and the former kevin1986 are both quite powerful. The former moderator in the forum, 3742668, is also a master among masters. Unfortunately, he is not online now...

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 8 Posted 2007-03-18 13:25 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Brother electronixtar, I can't download the file for uploading the system here. Post an IE version for me to take a look.
Floor 9 Posted 2007-03-18 13:28 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline

electronixtar brother, I can't download the file to upload the system here. Post an IE version for me to see.

Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
str = objIE.document.parentwindow.clipboardData.GetData("text")
WScript.Echo str
Floor 10 Posted 2007-03-18 13:35 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Is this to display the clipboard content?
Floor 11 Posted 2007-03-18 13:41 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Originally posted by zh159 at 2007-3-18 13:35:
Is this to display the clipboard content?

objIE.document.parentwindow.clipboardData.SetData "text", strCopy

strCopy is the obtained string
Floor 12 Posted 2007-04-13 13:46 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
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
Floor 13 Posted 2007-04-13 13:48 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Notepa 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 - Notepad Version"
InsAnswer = "Copy Path to Clipboard"
RegPath1 = "HKEY_CLASSES_ROOT\*\shell\PathCopyEx_Notepad\"
RegValue1 = "Copy Path to Clipboard"
RegForm1 = "REG_SZ"
RegPath2 = "HKEY_CLASSES_ROOT\*\shell\PathCopyEx_Notepad\command\"
RegValue2 = "wscript.exe " & Chr(34) & InsFullName & Chr(34) & " " & Chr(34) & "%L" & Chr(34)
RegForm2 = "REG_SZ"
RegPath3 = "HKEY_CLASSES_ROOT\Directory\shell\PathCopyEx_Notepad\"
RegValue3 = "Copy Path to Clipboard"
RegForm3 = "REG_SZ"
RegPath4 = "HKEY_CLASSES_ROOT\Directory\shell\PathCopyEx_Notepad\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)
WshSHell.popup _
"Add script file:" & Chr(10) & InsFullName & Chr(10) & Chr(10) & _
"Add registry entries:" & 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 Successful - " & 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
WshSHell.popup _
"Remove script file:" & Chr(10) & InsFullName & Chr(10) & Chr(10) & _
"Remove registry entries:" & 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 Successful - " & InsTitle & " - " & Copyright, 0 + 64
End If
If intAnswer = vbCancel Then
End If
ELSE
If (FSO.FileExists(FSO.BuildPath(FSO.GetSpecialFolder(0), "Notepad.exe"))) Or (FSO.FileExists(FSO.BuildPath(FSO.GetSpecialFolder(0), "Notepad.exe"))) Then
Set TempFile = FSO.CreateTextFile(FSO.BuildPath(TemFilePath, TemFileName), True)
TempFile.WriteLine(Args(0))
TempFile.Close
WshSHell.Run ("Notepad.exe " & FSO.BuildPath(TemFilePath, TemFileName))
WScript.Sleep 230
If WshSHell.AppActivate(TemFileName & " - Notepad") = True Then
WshSHell.Sendkeys "^{a}^{c}"
WshSHell.Sendkeys "%FX"
Else
WshSHell.AppActivate(TemFileName & " - Notepad")
WScript.Sleep 200
WshSHell.Sendkeys "^{a}^{c}"
WshSHell.Sendkeys "%FX"
End If
Else
WshSHell.popup + Chr(10) & _
"Operation failed!" & Chr(10) & Chr(10) & _
"Your system does not have Notepad installed, so your operation request failed!" & Chr(10) & Chr(10) & _
"Hehe....What alien system did you install? How come there is no 'Notepad'!" & _
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)
Floor 14 Posted 2007-04-13 13:50 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
IE 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 - IE Version"
InsAnswer = "Copy Path to Clipboard"
RegPath1 = "HKEY_CLASSES_ROOT\*\shell\PathCopyEx_IE\"
RegValue1 = "Copy Path to Clipboard"
RegForm1 = "REG_SZ"
RegPath2 = "HKEY_CLASSES_ROOT\*\shell\PathCopyEx_IE\command\"
RegValue2 = "wscript.exe " & Chr(34) & InsFullName & Chr(34) & " " & Chr(34) & "%L" & Chr(34)
RegForm2 = "REG_SZ"
RegPath3 = "HKEY_CLASSES_ROOT\Directory\shell\PathCopyEx_IE\"
RegValue3 = "Copy Path to Clipboard"
RegForm3 = "REG_SZ"
RegPath4 = "HKEY_CLASSES_ROOT\Directory\shell\PathCopyEx_IE\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 “" & InsAnswer & "” to the right-click menu," & Chr(10) & Chr(10) & "【No】Remove “" & InsAnswer & "” 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)
WshSHell.popup _
"Add script file:" & Chr(10) & InsFullName & Chr(10) & Chr(10) & _
"Add registry entries:" & 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 Successful - " & 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
WshSHell.popup _
"Remove script file:" & Chr(10) & InsFullName & Chr(10) & Chr(10) & _
"Remove registry entries:" & 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 Successful - " & InsTitle & " - " & Copyright, 0 + 64
End If
If intAnswer = vbCancel Then
End If
ELSE
Dim objIE
Set objIE = WScript.CreateObject("InternetExplorer.Application")
if objIE is Nothing then
WshSHell.popup + Chr(10) & _
"Operation failed!" & Chr(10) & Chr(10) & _
"Detected that your system does not have InternetExplorer installed, so your operation request failed!" & _
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
else
objIE.Visible = False
strCopy = Args(0)
objIE.Navigate("about:blank")
objIE.document.parentwindow.clipboardData.SetData "text", strCopy
Set objIE = Nothing
end if
End IF
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
Floor 15 Posted 2007-04-13 13:51 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Excel 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 - Excel Version"
InsAnswer = "Copy Path to Clipboard"
RegPath1 = "HKEY_CLASSES_ROOT\*\shell\PathCopyEx_Excel\"
RegValue1 = "Copy Path to Clipboard"
RegForm1 = "REG_SZ"
RegPath2 = "HKEY_CLASSES_ROOT\*\shell\PathCopyEx_Excel\command\"
RegValue2 = "wscript.exe " & Chr(34) & InsFullName & Chr(34) & " " & Chr(34) & "%L" & Chr(34)
RegForm2 = "REG_SZ"
RegPath3 = "HKEY_CLASSES_ROOT\Directory\shell\PathCopyEx_Excel\"
RegValue3 = "Copy Path to Clipboard"
RegForm3 = "REG_SZ"
RegPath4 = "HKEY_CLASSES_ROOT\Directory\shell\PathCopyEx_Excel\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)
WshSHell.popup _
"Add script file:" & Chr(10) & InsFullName & Chr(10) & Chr(10) & _
"Add registry entries:" & 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 Successful - " & 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
WshSHell.popup _
"Remove script file:" & Chr(10) & InsFullName & Chr(10) & Chr(10) & _
"Remove registry entries:" & 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 Successful - " & InsTitle & " - " & Copyright, 0 + 64
End If
If intAnswer = vbCancel Then
End If
ELSE
Dim objXL
Set objXL = WScript.CreateObject("Excel.Application")
If objXL Is Nothing Then
WshSHell.popup + Chr(10) & _
"Operation failed!" & Chr(10) & Chr(10) & _
"Detected that your system does not have Excel installed, so your operation request failed!" & _
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
Else
objXL.Visible = False
objXL.CutCopyMode = False
objXL.WorkBooks.Add
objXL.Range("A1").Value = Args(0)
objXL.Range("A1").Select
objXL.Range("A1").copy
objXL.DisplayAlerts = False
objXL.WorkBooks.Close
objXL.Quit
objXL.DisplayAlerts = True
Set objXL = Nothing
End If
End IF
Set WshSHell = Nothing
Set FSO = Nothing
Set Args = Nothing
WScript.Quit(0)
Forum Jump: