Jump to content

Recommended Posts

Posted

I'm using shortcut.exe to create shortcuts to other applications with no problem. What I'd really like to do is create a shortcut that replicate is what happens when you double-click "My Computer". It can be done by right-clicking "My Computer" and selecting "Create Shortcut", my question is how can this be accomplished via command-line or some other automated fashion?


Posted
I'm using shortcut.exe to create shortcuts to other applications with no problem. What I'd really like to do is create a shortcut that replicate is what happens when you double-click "My Computer". It can be done by right-clicking "My Computer" and selecting "Create Shortcut", my question is how can this be accomplished via command-line or some other automated fashion?

I do not know if this is what you wanted, but here is a VBS script that creates a shortcut on your

desktop that opens My Computer.

Save As Link_MyComputer.vbs

Const MY_COMPUTER = &H11&
Dim Act, Desktop, Link, ObjF, ObjFItem, Shell
Set Act = CreateObject("Wscript.Shell")
Set Shell = CreateObject("Shell.Application")
Set ObjF = Shell.Namespace(MY_COMPUTER)
Desktop = Act.SpecialFolders("Desktop")
Set Link = Act.CreateShortcut(Desktop & "\Computer.lnk")
Set ObjFItem = ObjF.Self
Link.TargetPath = ObjFItem.Path
Link.WindowStyle = 1
Link.Hotkey = "CTRL+SHIFT+A"
Link.IconLocation = "Shell32.dll, 15"
Link.Description = "Shortcut To My Computer"
Link.WorkingDirectory = Desktop
Link.Save

Posted

Nope, not what I was looking for... I'm looking to automate this:

It can be done by right-clicking "My Computer" and selecting "Create Shortcut", my question is how can this be accomplished via command-line or some other automated fashion?
I'm guessing I'll need to hext edit the shortcut and see what's diffeent about the target.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...