Jump to content

Syntax error running a .LNK


Docfxit
 Share

Recommended Posts

I can't figure out the correct syntax.

I'm trying to execute a lnk with:

Run(@ComSpec & " /c " & '"C:\Users\" & @UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Pegasus Mail\Pegasus Mail.lnk"', "", @SW_HIDE)

What I end up with is:

"C:\Users\" & @UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Pegasus Mail\Pegasus Mail.lnk"

If I run this:

Run(@ComSpec & " /c " & "C:\Users\" & @UserName & "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Pegasus Mail\Pegasus Mail.lnk", "", @SW_HIDE)

What I end up with is:

C:\Users\Jim\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Pegasus Mail\Pegasus Mail.lnk

When I execute it in a cmd line it runs this:

C:\Users\Jim\AppData\Roaming\Microsoft\Windows\Start

Does anyone know the correct syntax?

Thank you,

Docfxit

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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