How to create links in automatic?
Posted: 11 Mar 2018 19:20
Post results: to change a preexisting link use:
Be sure to use the & for the icons!!! if you don't the parameter won't be read
This will change the argument to the 2nd parameter and the icon to the 1st parameter
calli it like this in a batch file or via cmd:
Explanation:
is the existing link
is the dll containing the icon you want to use
is the parameter you want to output
Automatic creation is possible but can't supply all the parameters
use
in a *.vbs to make it work
You can use WScript.Arguments(0), WScript.Arguments(1), WScript.Arguments(2) to add more parameters for a faster call via another batch script
For automatic creation use:
Code: Select all
Set Shell = CreateObject("WScript.Shell")
Set link = Shell.CreateShortcut("pathto\linktomodify.lnk")
link.IconLocation = "pathto\icons.dll,"& WScript.Arguments(1)
link.Arguments = WScript.Arguments(0)
link.Save
This will change the argument to the 2nd parameter and the icon to the 1st parameter
calli it like this in a batch file or via cmd:
Code: Select all
scriptname.vbs "1st parameter" "2nd parameter" "more parameters up to 9"
Code: Select all
Set link
Code: Select all
link.IconLocation
Code: Select all
link.Arguments
Automatic creation is possible but can't supply all the parameters
use
Code: Select all
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set link = Shell.CreateShortcut(DesktopPath & "\winipcfg.lnk")
link.Arguments = ""
link.Description = "winipcfg shortcut"
link.HotKey = "CTRL+ALT+SHIFT+X"
link.IconLocation = ",0"
link.TargetPath = "c:\windows\winipcfg.exe"
link.WindowStyle = 1
link.WorkingDirectory = "d:\test"
link.Save
You can use WScript.Arguments(0), WScript.Arguments(1), WScript.Arguments(2) to add more parameters for a faster call via another batch script
For automatic creation use: