vbscript - Get Target Path of Shortcuts to Recycle Bin or Control Panel -
the following code gets target path of regular shortcuts.
set objshell = wscript.createobject("wscript.shell") set objshelllink = objshell.createshortcut(wscript.arguments(0)) set objfso = createobject("scripting.filesystemobject") strtargetpath = objshelllink.targetpath if (objfso.fileexists(strtargetpath)) ' link file. set objf = objfso.getfile(strtargetpath) else ' link folder. set objf = objfso.getfolder(strtargetpath) end if strfoldertoopen = """" & objf.parentfolder & """" stritemtoselect = """" & objf.name & """"
the objshelllink.targetpath
shortcuts (e.g recycle bin.lnk
, control panel.lnk
) empty.
how can target path of shortcuts?
Comments
Post a Comment