Menu

#930 Add support for the Windows OneDrive environment variable

open
nobody
Windows (8)
3
2025-09-03
2025-08-21
MrMe
No

I couldn't get the Windows %OneDrive% environment variable to work in a Run cmd.
Perhaps it's not currently supported. This FR is to recommend support be added for the OneDrive environment variable.

Discussion

  • Rony Shapiro

    Rony Shapiro - 2025-08-28

    Odd. All %env_var% substitution for the run command is done by Windows.
    Are you sure %OneDrive% is set in the context that pwsafe is running?

     
    • MrMe

      MrMe - 2025-08-30

      Hi Rony,

      Regarding 'Are you sure %onedrive% is set in the context that pwsafe is running?' How do I verify if it is or not? I do see the correct substitution for %onedrive% if I type SET in a CMD window.

      The Password Safe run cmd I'm using launches another windows application that takes command line arguments and one of my command line arguments has the %onedrive% in it, which is a path to an input file.

      I cut and pasted the run cmd I used in Password Safe with %onedrive% in it into a Windows system Run window and everything worked as expected. However, when Password Safe run cmd is used the windows application is launched, but the command line argument with %onedrive% in it is not substituted (you can tell since the launched application shows the path it is using for the command line argument with %onedrive% in it and it ends up being a non-existent path)

      For this particular case, replacing %onedrive% in the Password Safe run cmd with the correct substitution works, so if you want to close this ticket, that's okay with me.

       
  • Rony Shapiro

    Rony Shapiro - 2025-08-31

    What I did was just type in a dummy command, say, "echo", with the variable, and then checked the error message.
    For example, with the run command
    echo homedrive=%HOMEDRIVE% OneDrive=%OneDrive%
    I get an error message with the variables expanded:
    Windows cannot find 'echo homedrive=C: OneDrive=C:\Users...'.
    This shows that the expansion (substitution) is correct.

    Perhaps there are spaces in the path that require placing the path in quotes?

     
    • MrMe

      MrMe - 2025-09-03

      Hi Rony,

      Thanks for trying to help. I tried your example and got the same result you did. I also tried placing the path in quotes but that also did not solve the issue. The issue is probably caused by the application my run cmd launches. I can get by with not using the %onedrive% environment variable, but I'll try some other ideas before giving up.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.