Right-click to send (SendTo) to create a shortcut to a custom location _vbs

Source: Internet
Author: User
After adding a folder shortcut to the SendTo folder, a copy of these files is sent to the folder, which is actually a copy process, sometimes we just want to be a shortcut, then we have to find another way.

Save the following code as Shortcut.vbs, and then create a shortcut to the SendTo directory (C:\Documents and settings\username\sendto) and change the name you want, such as "create a shortcut to my working directory", To create shortcuts, and to support multiple files, simply change the strfolder in the 4th line of the script to the value you want:
Copy Code code as follows:

Set unnamedarguments = WScript.Arguments.UnNamed
Set WshShell = WScript.CreateObject ("Wscript.Shell")
Set objFSO = CreateObject ("Scripting.FileSystemObject")
Strfolder = "D:\temp\" must be followed by a symbol "\"
For count = 0 to wscript.arguments.count-1 Step 1
filename = Unnamedarguments.item (count)
Set objfile = objfso.getfile (filename)
Set oshelllink = Wshshell.createshortcut (strfolder & Objfso.getbasename (filename) & ". Lnk")
Oshelllink.targetpath = filename
Oshelllink.windowstyle = 1
Oshelllink.workingdirectory = objfso.getparentfoldername (filename)
Oshelllink.save
NEXT

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.