Created
November 16, 2014 09:15
-
-
Save dishuostec/9c9f1014701cdd0f80a2 to your computer and use it in GitHub Desktop.
put this file in SendTo folder
This file contains hidden or 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
| 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