Skip to content

Instantly share code, notes, and snippets.

@dishuostec
Created November 16, 2014 09:15
Show Gist options
  • Select an option

  • Save dishuostec/9c9f1014701cdd0f80a2 to your computer and use it in GitHub Desktop.

Select an option

Save dishuostec/9c9f1014701cdd0f80a2 to your computer and use it in GitHub Desktop.
put this file in SendTo folder
if WScript.Arguments.Count = 0 then
WScript.Echo "Missing parameters"
else
strTargetPath = WScript.Arguments.item(0)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strTargetPath)
strBaseName = objFSO.GetBaseName(objFile)
strTargetFolder = objFSO.GetParentFolderName(objFile)
set WshShell = WScript.CreateObject("WScript.Shell")
strStartUp = WshShell.SpecialFolders("StartUp")
set oShellLink = WshShell.CreateShortcut(strStartUp & "\" & strBaseName & ".lnk")
oShellLink.TargetPath = strTargetPath
oShellLink.WindowStyle = 1
oShellLink.WorkingDirectory = strTargetFolder
oShellLink.Save
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment