1

I use windows 7 SDK sample code to create and install a virtual folder on windows 7. It is not a real file system, it just a COM object which tells the windows explorer what should display, Like following: enter image description here

Now I want to create a shortcut for this virtual folder "Jerry" from the command line. I follow the instructions from this question: How to make a shortcut from CMD? and create the script:

@echo off
echo Set oWS = WScript.CreateObject("WScript.Shell") > CreateShortcut.vbs
echo sLinkFile = "%UserProfile%\\Links\\test.lnk" >> CreateShortcut.vbs
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> CreateShortcut.vbs
echo oLink.TargetPath = "Computer\Jerry" >> CreateShortcut.vbs
echo oLink.Save >> CreateShortcut.vbs
cscript CreateShortcut.vbs
del CreateShortcut.vbs

After run it, it only creates this one:

enter image description here

But if I just simply drag the virtual folder "jerry" from the explorer to the tree view of "Favoriates", it can create the shortcut normally: enter image description here

And right-click the virtual folder to create the shortcut also works: enter image description here

So how could I create the shortcut for the virtual folder from the command line ?

beasone
  • 189

0 Answers0