Community
    • Login

    %USERPROFILE% in File URI Link in Notepad++

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • xmaticX Offline
      xmatic
      last edited by

      I have this link in a text file in Notepad++:

      file:///C:/Users/john.doe/some_folder/test%20file.bat
      

      It uses the three slashes convention File URI Scheme to create a link in a text file in Notepad++

      If I double-click on this link, it runs the linked batch file.

      I want to change this link to:

      file:///%USERPROFILE%/some_folder/test%20file.bat
      

      This doesn’t work.

      Is there some character I can add or remove or escape to make it work?

      1 Reply Last reply Reply Quote 0
      • xmaticX Offline
        xmatic
        last edited by

        Just wanted to add:

        Windows 10 here. Using Notepad++ 7.5.9 obtained from the Microsoft Store.

        %USERPROFILE% is a Windows environment variable.

        Alan KilbornA 1 Reply Last reply Reply Quote 0
        • Alan KilbornA Online
          Alan Kilborn @xmatic
          last edited by

          @xmatic said in %USERPROFILE% in File URI Link in Notepad++:

          Using Notepad++ 7.5.9 obtained from the Microsoft Store.

          Don’t do this.

          As you’ve already discovered, Notepad++ doesn’t interpret “variables” such as these the same as Windows itself does. There is no workaround.

          1 Reply Last reply Reply Quote 0
          • xmaticX Offline
            xmatic
            last edited by

            Thanks.

            (The only reason I’m using the Microsoft Store version is that this is a work laptop and I don’t have admin privileges to otherwise make a portable install of Notepad++ the default text file handler. But your point is noted.)

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors