Trước hết bạn phải copy đoạn code này vào Notepad và lưu lại với cái tên là SendLinkToMail.vbs
'June 14, 2009 by doanngocthinh
'"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strSendTo = WshShell.SpecialFolders("SendTo") & "\"
strShortcutFileName = strSendTo & "\" & "Mail Recipient (as Path)" & ".lnk"
strMsg = "Completed!" & Chr(10) & Chr(10) & "SendLinkToMail.vbs - @ 2009 doanngocthinh" & Chr(10) & "Welcome to http://ngocthinhpro.blogspot.com"
Set objArgs = WScript.Arguments
If WScript.Arguments.Count > 0 Then
For I = 0 to objArgs.Count - 1
strLinks = strLinks & Replace(WScript.Arguments.Item(I)," ", "%20") & "%0A"
Next
'Customize the Recipient Email and Subject here
strRecipientEMail = ""
strMailSubject = "File Paths"
strMailSubject = Replace(strMailSubject," ","%20")
On Error Resume Next
WshShell.run "mailto:" & strRecipientEMail & "?Subject=" & strMailSubject & "&body=" & strLinks
If Err <> 0 Then
Select Case Err.Number
Case 70
If MsgBox ("Cannot send to mail as the parameters are too long. Do you want to output the file paths to a text file instead?",vbYesNo) = vbYes Then
strLinks = Replace(strLinks,"%20"," ")
strLinks = Replace(strLinks,"%0A",vbCrLf)
txtFilePaths= WshShell.ExpandEnvironmentStrings("%TEMP%") & "\FilePaths.txt"
Set b = objFSO.CreateTextFile (txtFilePaths,true)
b.WriteLine strLinks
b.close
WshShell.run "notepad.exe " & txtFilePaths
End If
Case Else
MsgBox "Error " & Err.Number & " occurred."
End Select
End If
On Error Goto 0
Else
rtn= Trim(UCase(InputBox ("Type INSTALL to add the MAIL RECIPIENT (as Path) to the Send To menu, or type UNINSTALL if you wish to remove the option.", "Configuring SendLinkToMail.vbs...", "INSTALL")))
If rtn = "INSTALL" Then RunInstall
If rtn = "UNINSTALL" Then RunUninstall
End If
Sub RunInstall
Set oShellLink = WshShell.CreateShortcut(strShortcutFileName)
oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.IconLocation = "sendmail.dll,-2001"
oShellLink.Save
MsgBox strMsg, vbokonly,"Installed"
End Sub
Sub RunUninstall
if objFSO.fileexists(strShortcutFileName) then objFSO.deletefile(strShortcutFileName)
MsgBox strMsg, vbokonly,"Uninstalled"
End Sub
Chạy file này bạn sẽ nhận được 1 hộp thoại yêu cầu kích hoạt, bấm OK
Sau đó tìm file hay nội dung nào muốn gửi, bấm chuột phải vào nó chọn Send To/Mail Recipient (as Path), tiếp tục gõ địa chỉ mail và tiêu để muốn gửi, và những gì sau đó thì bạn đã biết.
Nếu bạn muốn gỡ bỏ ứng dụng này thì chạy lại file này và gõ vào chữ UNINSTALL rồi OK vậy là xong
Trấn Phiên
Bài viết hay lắm cảm ơn bạn rất nhiều!
Trả lờiXóaNhưng khi mình sd thì lại hiện lên micrsoft outlook chứ không hiện lên outlook express.
(Mình chỉ làm việc trên outlook express thui)
Bạn hướng dẫn giúp mình nha! (xin gởi mail cho mình anlo@vinanco.com )
Thanks rất nhiều. Rất mong sớm nhận được hướng dẫn của bạn.