A scriptor for a "send to any folder shortcut"

xiaoxiao2021-03-06  40

Due to the recent songs, "My Music" is in the disk space, so I think that moving music to another disk, and in the "My Music" folder only reserves the shortcut to these music, so I wrote this script. '********************************************************** ************ '* name: ' * author: soaktech '* Date: 22/02/2005' ************* ****************************************************************** CONST WINDOW_HANDLE = 0Const NO_OPTIONS = 0Set objShell = CreateObject ( "Shell.Application") Set objFolder = objShell.BrowseForFolder _ (WINDOW_HANDLE, "select the file you want to send a shortcut to the folder:", NO_OPTIONS) If Not objFolder is Nothing then Set objFolderItem = objFolder . Self objPath = ObjfolderItem.path strDestination = Objpath

Set objargs = wscript.arguments set wshshell = wscript.createObject ("wscript.shell")

For i = 0 to objArgs.Count - 1 strShortCut = strDestination & "/" & GetMyFileName (objArgs (i)) & ".lnk" set objShellLink = WshShell.CreateShortcut (strShortCut) objShellLink.TargetPath = objArgs (i) objShellLink.WindowStyle = 1 objshelllink.workingdirectory = left (Objargs (i), INSTRRRREV (Objargs (i), "/")) ObjshellLink.save next msgbox "End", VBOK, "End" else msgbox "Thank you", VBOK, " End "end if

Function GetMyFileName (DriveSpec) Dim fso Set fso = CreateObject ( "Scripting.FileSystemObject") GetMyFileName = fso.GetFileName (DriveSpec) End Function Now, at this point to establish Sendto folder shortcut VBs, and choose a nice icon, you Can send shortcuts like "sending shortcuts to desktop" to any folder!

转载请注明原文地址:https://www.9cbs.com/read-52423.html

New Post(0)