Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use vbs right to send sendto and create shortcuts to custom locations

Shulou Source: shulou.com Published: 2022-06-03 06:45:07 11月15日 Update

This article mainly introduces how to use vbs right to send sendto and create shortcuts to a custom location, with a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.

After adding a shortcut to a folder in the SendTo folder, right-click to send a copy of these files to this folder, which is actually a process of copying. Sometimes we just want to be a shortcut, so we have to find another way.

Save the following code as shortcut.vbs, then create a shortcut to the sendto directory (C:\ Documents and Settings\ username\ SendTo), change the name you want, such as "create a shortcut to my working directory", and support multiple files. You only need to change the strFolder in line 4 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\" 'should 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

Thank you for reading this article carefully. I hope the article "how to use the vbs right button to send sendto and create shortcuts to a custom location" shared by the editor will be helpful to you. At the same time, I hope you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!

Tags: Way file article folder location directory support code value interest content copy method at the same time name actual actually more sometimes friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux OPPO Reno Docker Huawei