Created
October 12, 2021 04:02
-
-
Save Ancientwood/ddab0e8e35a6855d674b4bd7c92245ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Const strDestination = "C:\Users\user\Desktop\shortcut" | |
Set objArgs = WScript.Arguments | |
Set WshShell = WScript.CreateObject("WScript.Shell") | |
For i = 0 to objArgs.Count - 1 '' Loop through all arguments. | |
strShortCut = strDestination & "\" & GetAName(objArgs(i)) & ".lnk" | |
set oShellLink = WshShell.CreateShortcut(strShortCut) | |
oShellLink.TargetPath = objArgs(i) | |
oShellLink.WindowStyle = 1 | |
oShellLink.WorkingDirectory = Left(objArgs(i), InStrRev(objArgs(i), "\")) | |
oShellLink.Save | |
Next | |
Function GetAName(DriveSpec) | |
Dim fso | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
GetAName = fso.GetBaseName(DriveSpec) | |
End Function | |
''end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment