

' oLink.IconLocation = "C:\Program Files\MyApp\MyProgram.EXE, 2" Set oLink = oWS.CreateShortcut(shortcutPath) WScript.Echo "Creating shortcut " & shortcutPath & " targetPath=" & targetPath & " arguments=" & arguments & " workingDir=" & workingDir ShortcutPath = wscript.arguments(0) & ".LNK" WScript.Echo "usage: makeshortcut.vbs shortcutPath targetPath arguments workingDir " On XP I wrote makeshortcut.vbs Set oWS = WScript.CreateObject("WScript.Shell") Modify the script instead to use special folders. That said I urge you not to use hardcoded paths like "Start Menu" since they're different in localized versions of windows. Save the file as createLink.vbs and call it like this to get what you originally tried: cscript createLink.vbs "C:\Documents and Settings\%USERNAME%\Desktop\Program1 shortcut.lnk" "c:\program Files\App1\program1.exe"Ĭscript createLink.vbs "C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Program1 shortcut.lnk" "c:\program Files\App1\program1.exe" ObjSC.WorkingDirectory = sWorkingDirectory Set objSC = objWSHShell.CreateShortcut(sShortcut) SWorkingDirectory = objFso.GetAbsolutePathName(sShortcut) STargetPath = objWSHShell.ExpandEnvironmentStrings((1)) SShortcut = objWSHShell.ExpandEnvironmentStrings((0)) Set objFso = CreateObject("Scripting.FileSystemObject") You should try the NT version here.Īlternatively use a little VBScript that you can call from the command line: set objWSHShell = CreateObject("WScript.Shell") Since a symlink is just a virtual folder that just acts as a path to the real folder, you don’t have to worry about the symlink consuming your disk space.Your link points to a Windows 95/98 version and I guess you have at least Windows 2000 or XP. In those situations you can simply create a symlink in the cloud service folder so that you can sync the contents of the target folder without actually moving or copying the real folder. However, you don’t want to move the folder from its actual location or don’t want to create a copy of the folder. But there will be times when you might have a folder in some other drive you want to sync with the cloud storage service.Īlso read: 4 Easy Ways to Copy a Large Number of Files Quickly in Windows Simply put, a symlink is nothing more than a build of the text string which lets the operating system know that it is just a path for another file or folder.įor instance, most cloud service apps you install will only sync files and folders located in their own folder. Besides files, you can also create symlinks for folders. When you create a symlink for a file, it appears as if it is the actual file when in reality it is redirecting you toward the real file in the background. They act as a virtual file or folder that links to the actual file or folder. Symbolic links are much more than a simple shortcut.


When you create a shortcut for a file or folder, all you are doing is pointing it to that specific file or folder, nothing more.
