Giter Site home page Giter Site logo

pathed's Introduction

windows PathEd

Without PathEd, it can be quite cumbersome to handle the old-school semicolon-devided PATH variable safely.

PathEd has no dependencies besides the .NET Framework 2.0 and can be deployed with any installer, for example. Editing the PATH within your setup is just one single exec command instead of using proprietary PATH manipulation plugins, etc.

Examples

Add a value to the Windows PATH:

PathEd.exe add "C:\Program Files\RepoZ"

Remove a value from the Windows PATH:

PathEd.exe remove "C:\Program Files\RepoZ"

Usage in a NSIS install script:

PathEd is used in the RepoZ NSIS install script to add and remove the application location to the Windows PATH.

Noteworthy

PathEd will ...

  • ... just add values if they are new to the PATH. So it can be called multiple times.
  • ... ignore removals if the value is not part of the PATH. So it can be called multiple times as well.
  • ... compare values against the PATH (whether it should add or can remove values) case-insensitive.
  • ... remove values even if the PATH defines them in quotes.

As always, you'll need to add quotes to the value if it contains spaces (like shown in the examples). Otherwise, Windows will split them up as multiple arguments.

pathed's People

Contributors

awaescher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pathed's Issues

pathed changes env var registry key type from REG_EXPAND_SZ to REG_SZ

Was testing using PathEd for an installer and noticed that it changes the Path registry key type from REG_EXPAND_SZ to REG_SZ at least on windows 11, that breaks plenty of things.

Is there any way to avoid that?

edit: removed mention to other windows versions it seems to only happen on windows 11

NSIS usage example

Hi.
According to your post (atleast i think it is you) on
stackoverflow you recommend this to be used for safe enviromental updates with NSIS.

However i cannot get this to work.
Do you have any usage example how to use it?

i tried with the following without any lock
install path is "c:\demo path"
'''
File "PathEd.exe"
ExecWait "c:\demo path\PathEx.exe add $"c:\demo path$""
'''
Br
Stefan

Include a licence

Hi,

I'd like to use PathEd in my own NSIS installer, but without any explicit licence I just can't do it.

I suggest you include a permissive licence text in your repo e.g: Apache, to allow other people redistribute your executable as part of their installers.

Thank you for the tool!

Is PathEd still maintained?

Hello there,
It seems like PathEd is not actively maintained and the last commit was ages ago. If you want/can, you should add a note to use a tool more actively maintained and feature-rich for Windows. And yes, it's a repository maintained by me!

Please see github.com/ANF-Studios/WinPath. It's actively under development and a lot is planned.

Trouble with remove

for example

i have a path variable with "C:\Program Files\ojdkbuild\java-1.8.0-openjdk-1.8.0.332-1\jre\bin" and i do 'pathed remove "332"' it will remove 332 from "C:\Program Files\ojdkbuild\java-1.8.0-openjdk-1.8.0.332-1\jre\bin" so "C:\Program Files\ojdkbuild\java-1.8.0-openjdk-1.8.0.-1\jre\bin" will be left.

trying to delete "C:\Program Files (x86)\ojdkbuild\java-1.8.0-openjdk-1.8.0.332-1\webstart" - doesnt work

pathed.exe remove "C:\Program Files (x86)\ojdkbuild\java-1.8.0-openjdk-1.8.0.332-1\jre\bin"
worked

pathed.exe remove "C:\Program Files (x86)\ojdkbuild\java-1.8.0-openjdk-1.8.0.332-1\bin"
worked

pathed.exe remove "C:\Program Files (x86)\ojdkbuild\java-1.8.0-openjdk-1.8.0.332-1\webstart"
does not work, maybe the last "" will be the problem

Great tool but needs some fine tuning :) or may i am doing something wrong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.