Created
          December 4, 2015 01:33 
        
      - 
      
 - 
        
Save julenka/c40aade62c8fd8d29d4b to your computer and use it in GitHub Desktop.  
    MakeShortcut
  
        
  
    
      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 "Usage: make-shortcut.vbs shortcutName shortcutWorkingDir shortcutPath shortcutArgs..." | |
| Wscript.Quit | |
| end if | |
| Dim shortcutName | |
| Dim shortcutPath | |
| Dim shortcutWorkingDir | |
| Dim shortcutArgs | |
| shortcutName = Wscript.Arguments(0) | |
| shortcutWorkingDir = Wscript.Arguments(1) | |
| shortcutPath = Wscript.Arguments(2) | |
| For count = 3 To WScript.Arguments.Count-1 | |
| shortcutArguments = shortcutArguments & " " & Wscript.Arguments(count) | |
| Next | |
| Set sh = CreateObject("WScript.Shell") | |
| Set shortcut = sh.CreateShortcut(shortcutName) | |
| shortcut.TargetPath = shortcutPath | |
| shortcut.Arguments = shortcutArguments | |
| shortcut.WorkingDirectory = shortcutWorkingDir | |
| shortcut.Save | |
| Wscript.Echo "Made shortcut " & shortcutName & " with target path " & shortcutPath | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment