dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Custom hyperlinks in Windows 10

Hybrid View

  1. #1
    Join Date
    Mar 2019
    Posts
    2

    Custom hyperlinks in Windows 10

    I'm having a problem and I'm not sure how to proceed. I'm using a custom url protocol to open remote desktop (and a few other internal programs) and it works fine on Windows 7. It doesn't work on Windows 10, however, and I'm not sure what's wrong. This is my installer, the script language is called Nullsoft, and it's pretty self explanatory. It is NOT an issue with the script itself, I can verify that it is running correctly and that all of the registry entries are created, they just don't seem to be the right entries for Windows 10. I restarted the computer as well just to be sure.

    Code:
    Outfile hyperlink_installer.exe
    
    Section
     
    #Check to make sure we have admin rights
    UserInfo::getAccountType
    Pop $0
    StrCmp $0 "Admin" +3
    MessageBox MB_OK "Please run as admin: $0"
    Return
    
    #Write the RPD hyperlink installer
    FileOpen $9 C:\Windows\hyperlink-rdp.js w
    FileWrite $9 "var server=(WScript.Arguments(0))$\r$\n"
    FileWrite $9 "var prefix='rdp://'$\r$\n"
    FileWrite $9 "var app='C:\\WINDOWS\\system32\\mstsc.exe'$\r$\n"
    FileWrite $9 "server=server.replace(prefix, '')$\r$\n"
    FileWrite $9 "server=server.replace('/', '')$\r$\n"
    FileWrite $9 "var shell = new ActiveXObject('WScript.Shell')$\r$\n"
    FileWrite $9 "shell.Exec(app + ' /v:' + server)$\r$\n"
    FileClose $9
    
    #Write the RDP registry keys
    WriteRegStr HKCR "rdp" "" "URL:Remote Desktop Connection"
    WriteRegStr HKCR "rdp" "URL Protocol" ""
    WriteRegStr HKCR "rdp\DefaultIcon" "" "C:\WINDOWS\System32\mstsc.exe"
    WriteRegStr HKCR "rdp\shell\open\command" "" "wscript.exe C:\WINDOWS\hyperlink-rdp.js %1"
    
    SectionEnd
    I'm at a loss and not sure where to even look next. The registry looks very similar to the http entries for the same thing and works fine in Windows 7 (at least my machine.)

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,986

    Re: Custom hyperlinks in Windows 10

    Are both machines 32-bit or is the Win10 machine 64-bit? If 64-bit, the mstsc.exe path may be incorrect. Also, does hyperlink-rdp.js exist in the windows folder on the target machine?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)