Docfxit Posted January 28, 2010 Share Posted January 28, 2010 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 More sharing options...
Richard Robertson Posted January 28, 2010 Share Posted January 28, 2010 Run(@ComSpec & " /c " & '"C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Pegasus Mail\Pegasus Mail.lnk"', "", @SW_HIDE) Link to comment Share on other sites More sharing options...
Docfxit Posted January 28, 2010 Author Share Posted January 28, 2010 Run(@ComSpec & " /c " & '"C:\Users\' & @UserName & '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Pegasus Mail\Pegasus Mail.lnk"', "", @SW_HIDE) That fixed it. It's so nice of you to show me the correct way. Thank you very much, Docfxit Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 28, 2010 Share Posted January 28, 2010 Quotes can be difficult in strings. A lot of us have trouble now and then. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now