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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -