Right-click send (sendto) and create vbs from shortcut to custom location

Source: Internet
Author: User

After adding a folder shortcut to the SendTo folder, right-click the folder to send a copy of these files, which is actually a copy process. Sometimes we only want a shortcut, you have to find another solution.

Save the following code as your cut. vbs, create a shortcut to the sendto directory (C: \ Documents ents and Settings \ username \ SendTo), and change the name you want, for example, "Create a shortcut to my working directory" can be used to create a shortcut. In addition, to support multiple files, you only need to change the strFolder in line 4th of the script to the value you need:

Set unNamedArguments = WScript. Arguments. UnNamed

Set WshShell = WScript. CreateObject ("WScript. Shell ")

Set objFSO = CreateObject ("Scripting. FileSystemObject ")

StrFolder = "d: \ temp \" must be followed by the 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.