Windows 10: Is there a universal variable for the path to a program

Discus and support Is there a universal variable for the path to a program in Windows 10 Support to solve the problem; I have noticed on several occasions that during the installation of a program downloaded from the internet that there was some sort of variable in the... Discussion in 'Windows 10 Support' started by blockie, Aug 6, 2016.

  1. blockie Win User

    Is there a universal variable for the path to a program


    I have noticed on several occasions that during the installation of a program downloaded from the internet that there was some sort of variable in the path to the installation folder I would just accept the default and the installation went OK.
    I assumed that the variable was to accommodate the different OS's.
    I have a small program that I created that I wanted to make available to the public. However, this program was created with the thought of using it myself. so I did not pay attention to the paths except to make it work. Now that I wish to make it available I should make the installation easier. The current path on my computer is "C:\users\bill\documents\FUND" and it branches from there. I assume that the variable in question is to replace the user. I hope I have made this clear enough that it can be understood.
    I'm looking for a place that describes this variable and how I might be able to use it in my installation instructions.
    Bill

    :)
     
    blockie, Aug 6, 2016
    #1

  2. Is there a way to reset the default program for a file type to nothing?

    Original Title - Reset Default Programs

    Is there a way to reset the default program for a file type to nothing?
     
    TeenyDeeno, Aug 6, 2016
    #2
  3. Is there a way to reset the default program for a file type to nothing?

    Hi,



    Thank you for contacting Microsoft Community.

    There is no option to reset the default program for a file type to nothing. You need to choose the default options. We request you to provide us the feedback using the feedback app, so that it will reach our concern team.

    Hope this information is helpful and do let us know if you need further assistance. We will be glad to assist.
     
    Karthicka_R, Aug 6, 2016
    #3
  4. lx07 Win User

    Is there a universal variable for the path to a program

    It would be best to use a relative path so the end user can place your program anywhere they want.

    You don't say what language you are using but in powershell this will give you the current directory or working directory for .NET Code: (Get-Item -Path ".\" -Verbose).FullName[/quote] You could then add your directory structure to the end of this path.

    Another approach is to have the program somewhere (perhaps "C:\Program Files" but could be anywhere) and store the data somewhere else (like the users %appdata% or documents directory).

    Again in Powershell (other languages have different syntax but the idea is the same) these would be: Code: $env:LOCALAPPDATA\FUND ---> C:\Users\bill\AppData\Local\FUND $env:homeDrive$env:homePath\Documents\FUND --> C:\Users\bill\Documents\FUND[/quote]
     
    lx07, Aug 6, 2016
    #4
  5. blockie Win User
    The program is written in Quattro Pro and uses QP macros as well as Perfectscript macros. Both of these are part of WordPerfect Office X7.
    I am not very tech savvy so talk to me as if I am from an older generation . I am, in fact, 85.
    Bill
     
    blockie, Aug 6, 2016
    #5
  6. Samuria Win User
    Path is a separate thing if from a Cmd prompt you type set it will show you the path this means windows etc will look in those folders for any file to run. You talking insulation folder how many files in your programme you can get free software which will package your software into an install and that will copy the files set folders etc. It depends on your software which is best for you
     
    Samuria, Aug 6, 2016
    #6
  7. lx07 Win User
    I don't know these programs I'm afraid.

    Having a look for some documentation I found this: Batch export WordPerfect documents to PDF or DOC - Sample Macros - PerfectScript - OfficeCommunity.com

    This macro appears to be changing .wpd to .pdf and the .pdf is created in the place ?Path with name being the same just changing File_name.wpd to File_name.pdf. So it appears that you can use ?Path and this will define where your program is.

    At a guess therefore if you replaced in your program anywhere you've explicitly typed C:\Users\bill\Documents\FUND\ with ?Path then it might work. If you do this and it works for you then it would work for anyone.

    Hopefully someone how uses these programs will be able to help but if not it may be worth a try.
     
    lx07, Aug 6, 2016
    #7
  8. dalchina New Member

    Is there a universal variable for the path to a program

    Hi, I think you're thinking of e.g.
    %userprofile%
    - an environmental variable in Windows.
    Try literally typing that into the address bar in explorer. That should take you to
    C:\users\bill\

    For more variables, open a command prompt and simply type
    set

    This relies on that string being interpreted by Windows, of course, which you mentioned you wanted to happen during installation.
     
    dalchina, Aug 6, 2016
    #8
  9. blockie Win User
    Unless literally means something different than I understand the results are inconsistent. I just typed in $userprofile$ and the W10 explorer did a search of C: drive and when not found it searched the internet and returned this."Server not found

    Firefox can't find the server at www.$userprofile$.com." I'll keep working at it.

    Bill
     
    blockie, Aug 7, 2016
    #9
  10. dalchina New Member
    No, literally is exactly - try it this way. Copy all the characters on the line below
    %userprofile%
    exactly as you see them into the address bar of explorer.
    Those are %'s not $'s
     
    dalchina, Aug 7, 2016
    #10
  11. blockie Win User
    Now it works when I use the correct prefix and suffix % % %%%%. THANKS.

    I would like to go to the documents folder then I can add one new folder FUND. I have tried %userprofile%+\documents\ Windows doesn't like it.

    Bill
     
    blockie, Aug 7, 2016
    #11
  12. dalchina New Member
    Hi, that's simply
    %userprofile%\documents
     
    dalchina, Apr 4, 2018
    #12
Thema:

Is there a universal variable for the path to a program

Loading...
  1. Is there a universal variable for the path to a program - Similar Threads - universal variable path

  2. Is PATH is on the User Variables, or System Variable?

    in Windows 10 Gaming
    Is PATH is on the User Variables, or System Variable?: Hello, I have a problem with my PATH variable in my Windows 8.1 computer.1. Where it all starts:I installed SQLite on my computer, and then i want to test it from Command Prompt with this command:sqlite3 test.dbBut the output is:'sqlite3' is not recognized as an internal or...
  3. Is PATH is on the User Variables, or System Variable?

    in Windows 10 Software and Apps
    Is PATH is on the User Variables, or System Variable?: Hello, I have a problem with my PATH variable in my Windows 8.1 computer.1. Where it all starts:I installed SQLite on my computer, and then i want to test it from Command Prompt with this command:sqlite3 test.dbBut the output is:'sqlite3' is not recognized as an internal or...
  4. Changes of PATH Variable

    in Windows 10 Gaming
    Changes of PATH Variable: Hello there,I changed the PATH Variable and added another directory to implement the given commands under DOS.The strange thing is, that this works fine as Administrator and absolutely not, when logged in with a non-administrator account.What do I do wrong?Kind regards...
  5. Changes of PATH Variable

    in Windows 10 Software and Apps
    Changes of PATH Variable: Hello there,I changed the PATH Variable and added another directory to implement the given commands under DOS.The strange thing is, that this works fine as Administrator and absolutely not, when logged in with a non-administrator account.What do I do wrong?Kind regards...
  6. Cannot recover the path variable

    in Windows 10 Gaming
    Cannot recover the path variable: I was editing the Path variable in the system section and I accidentally deleted the whole thing, I tried using echo %PATH% to restore the variable but, it doesn't work as I was having Python installed working fine with command prompt but now it says Python not found, but the...
  7. Can't add to Path variable

    in Windows 10 Support
    Can't add to Path variable: Win10 Pro 20H2 In the Sytem variables section of the System Properties dialogue I add a bona fide folder name, OK, then immediately it is as though I had done nothing. No denials, no objectons, just absent. 174240
  8. Multiple PATH environment variables

    in Windows 10 Ask Insider
    Multiple PATH environment variables: [ATTACH] There's a package that I want to install and it says in order to install it, it needs to be added to the PATH. Upon checking my environment variables, I noticed there are three of them as shown:...
  9. regarding path variable of user variable of environment variable

    in Windows 10 Customization
    regarding path variable of user variable of environment variable: please help me fast, I accidentally deleted path variable of user variable ..... I want to restore it. the real situation is I cannot run android studio project and it shows error - " unable to start daemon process............This problem might be caused by incorrect...
  10. Environmental variable/path

    in Windows 10 Installation and Upgrade
    Environmental variable/path: Hello community, I need some help. I was attempting to download Oracle JDK/JRE and somehow corrupted my path. Can anyone tell me the default path setting that I need to restore? I appreciate your help....