开发者

is there possible to open any shortcut icons propery window using vb script

开发者 https://www.devze.com 2023-02-20 18:22 出处:网络
is there possible to open any shortcut icons propery window using vb scr开发者_开发技巧ipt. my main problem is that i want open property window and click apply or ok button with the help of codingTo w

is there possible to open any shortcut icons propery window using vb scr开发者_开发技巧ipt. my main problem is that i want open property window and click apply or ok button with the help of coding


To work with shortcuts in VBScript, you can use the WshShortcut scripting object. For example, to get or set the shortcut's target path, use the TargetPath property. Note that when you set the TargetPath, Windows automatically converts short paths (C:\PROGRA~1\foo.exe) to long paths (C:\Program Files\foo.exe):

Set oShell = CreateObject("WScript.Shell")

' Create a new shortcut or open an existing shortcut    
strShortcutPath = oShell.SpecialFolders("Desktop") & "\7-Zip.lnk"
Set oShortcut = oShell.CreateShortcut(strShortcutPath)

' Set the shortcut properties and save the changes
oShortcut.TargetPath = "C:\PROGRA~1\7-Zip\7z.exe"
oShortcut.Save

WScript.Echo oShortcut.TargetPath ' Shows C:\Program Files\7-Zip\7z.exe
0

精彩评论

暂无评论...
验证码 换一张
取 消