DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Finished Programs => Topic started by: mtp on May 03, 2005, 08:31 AM

Title: DONE - IDEA: modify system path (System Path Commander)
Post by: mtp on May 03, 2005, 08:31 AM
an app that adds a specified folder to windows path so it can be run from anywhere .. maybe a commandlineapp like:
add2path.exe "c:\program files\dydlo\"
or even add the function to the explorerrightclickmenu so that you can simply click on a icon to add the path of the app!
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: mouser on May 03, 2005, 08:48 AM
i happen to think a nice interactive tool to help modify the environment path in a safe way (keeping backup copies of all past settings), is a FANTASTIC little snack idea.
  if someone doesn't code this by the next coding snack weekend i will do it.
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: Scott on May 08, 2005, 01:45 AM
an app that adds a specified folder to windows path so it can be run from anywhere .. maybe a commandlineapp like:
add2path.exe "c:\program files\dydlo\"
or even add the function to the explorerrightclickmenu so that you can simply click on a icon to add the path of the app!

You can do this easily, yourself, without a program.  (More accurately, without a compiled program.)  Just add the program name(s) as a subkey to the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

For example, Insecure Explorer is represented with the following key and values:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE
(Default) = C:\Program Files\Internet Explorer\iexplore.exe
Path = C:\Program Files\Internet Explorer;

This can be done with a batch script and a command line util like NirCmd (http://www.nirsoft.net/) (to create the applicable registry values and key).  Adding a context menu item is easy, too.

If I had time, I'd put together the script to do it.  But I don't want to make promises I can't keep.
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: mouser on May 08, 2005, 01:57 AM
let me explain why i htink this would be a good snack.

my windows xp environment path is too long.

thank you bill gates for putting much too short limits on it. the madness never ends.

so i'm constantly having to watch it and remove stuff and worry about removing something i might later need.

so having a nice safe way to add stuff, disable stuff, and always making sure never to lose anything permanently, would be good even for me who is comfortable changing such stuff manually.
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: Scott on May 08, 2005, 03:29 AM
Your %path% is over 8,191 chars long?

http://support.microsoft.com/default.aspx?scid=kb;en-us;830473

AFAIK, "App Paths" has no limit, so you'd never have to remove and re-add a program.
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: mouser on May 08, 2005, 07:26 AM
8000 dream on..

the limit seems to choke out for me around 1000.

not sure what to make of msdn saying 2047/8000...

maybe i'll experiment later and see exactly where the trouble begins..
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: mtp on May 09, 2005, 05:07 AM
call me dumb .. cause i am! .. all i wanted was to add a path like "c:\program files\mplayer" to windows path so i could run mplayer from anywhere through cmd.exe .. and now i "discovered" the command "path" .. a bit of experimenting with it and then i got it .. i added the path by simply typing:
path "c:\program files\mplayer\";%path%
thats it .. thanks to autocompletion that was not so much writing ..
god damnit ...
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: Scott on May 09, 2005, 02:16 PM
Yeah, that will work, but it's clunky and kludgy, and you'll eventually run into trouble, as mouser points out above.  I still recommend using the App Paths registry key.
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: Scott on May 09, 2005, 05:16 PM
This should fit the bill:

AppPathZ (freeware)

On SnapFiles.com: http://www.snapfiles.com/get/apppathz.html
Home Page: http://izoxzone.150m.com/product/app/ap/index.htm

I have not tried it, but a quick glance seems to indicate that it's what you're after, mtp.

Keep in mind that adding values to the aforementioned App Paths registry value will affect all users--in case that matters to you.  (I can't see why it would, but...)  The %path% environment variable has both a user- and machine-level component.
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: mouser on May 10, 2005, 05:21 PM
chr has send me a beta of an app to do what i had in mind, let you easily check and uncheck entries, reorder entries, add entries, etc.  all in a nice gui with a good backup log.

really excellent.. when he finishes it i will add it to coding snacks download page.
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: chr15 on May 15, 2005, 11:31 PM
Hi,

I thought I would create a little GUI app to do this, the idea was fairly simple to start with,
but it has since been extended many times via the requests from mouser

I cannot thank mouser enough for the name of the app, icon, and especially the testing and ideas :) , but the extra work, hmm maybe ;).

But as you will see soon, I hope you think it is worth it, at least I can say I definitely will use this app.

Chr15
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: mouser on May 15, 2005, 11:46 PM
i have to say i love what chr has done, and it's exactly the app i've been wanting.
it should be up on the coding snacks download page this week.
Title: Re: IDEA: commandline to add specified directory to "windows path"
Post by: mouser on May 20, 2005, 02:26 PM
"System Path Commander" has now been added to the Coding Snacks Download Page:
https://www.donationcoder.com/CodingSnacks/index.php

you will find a screenshot and a readme there as well.

This program was far beyond the original request, and went beyond what i had hoped even.  It's a fantastic tool for power users who want to modify their system path.  one of my favorite snacks so far.  It's not going to be of use to everyone, but those who mess with their system path will love it.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: Scott on May 22, 2005, 05:13 PM
Nice job on System Path Commander.  I tried AppPathZ (as mentioned above), and didn't like it at all.  So I thought I'd mention another freeware alternative for editing the "App Paths" registry key: AppPaths (http://www.gregorybraun.com/AppPaths.html).
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: mouser on May 22, 2005, 06:16 PM
one thing that may need clarification..


both of the other appPath programs are designed for editing a windows registry key that related to paths to specific programs.

System Path Commander does something completely different.
It helps you manage the global system path, which is used when the system searches for programs that are executed.

For example if you have perl or a c++ compiler installed, their paths typically get added to the global system path, so that the compiler tools and interpreters can be found when invoking them.

I think it's also importan to note that SPC turned out to be a significant amount of work.
On the surface its a very simple idea, after all you are just editing a list of directories.
However, if you use the program you will see that some serious work went into making it safe (it keeps detailed logs, is careful about not saving when not asked, etc.), and most importantly, it has features for letting you temporarily disable entries by removing them from the registry key for environment path, but keeping a careful record of them, and their proper order, etc.  the program also has a bunch of cool extra features, like indicating new keys, letting you drag and drop to change order, converting long paths to short versions to save space, etc.

it's a unique program as far as i know.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: Scott on May 22, 2005, 07:17 PM
I personally did know the difference between the App Paths key and the %path% env var...  Just thought I'd mention those utils in case someone found them applicable to their problem.  Sorry if it didn't fit here.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: Dragonrider on May 23, 2005, 12:32 AM
I have a problem / pet peeve with System Path Commander.  It's not with the handling of paths though.  It's the UI.

My pet peeve is that alot of coders Ass-U-Me that everyone out there has a light background & dark characters for their desktop default colors.  This is not the truth for those of us who are visually impaired & need the high contrast of light colored characters on a dark background.  System Path Commander Ass-U-Mes this.  It is a totally useless program for me because the white characters I use are unreadable on the light blue background.

Flame Off

Is it possible to change the interface to use system default colors?  Or at least to let me define what colors are going to be used in the interface.

Thanks in advance.

Regards
Dragonrider
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: mouser on May 23, 2005, 01:46 AM
ill pass this along to chr, i'm sure he will change it (or add option to change it).
personally i love the blue background..

it seems this touched a raw nerve with you :) - just don't get mad at chr, im sure he didnt realize that there would be issues for visually impaired..

so here's a question for you, in spc, it uses 2 alternative colorings to indicate that an entry is either invalid (red) or changed (gree),
are those also unreadable, and if so, what would you recommend from a visually imparied standpoint, regarding colors..
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: chr15 on May 23, 2005, 01:51 AM
Hi,

Thanks for the feedback.

As KC indicated this is a valid point for users with different visual needs, and as such there will be v1.18 with Colour configuration, I will implement this when I get home tonight, and hopefully it will be on line in 12hrs or so.

Chr15
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: chr15 on May 23, 2005, 04:23 PM
Hi,

v1.18 of spc has been uploaded to mouser, now you just have to wait until, mouser has processed it.

You can now customize the colours to your personal taste or needs :)

Chr15
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: mouser on May 23, 2005, 08:20 PM
coding snacks downlload page has been updated.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: Dragonrider on May 24, 2005, 12:35 AM
Hi Mouser & Chr15:
Thank you VERY much for the quick response & sensitivity to others problems.

> =========== Mouser Wrote: ===========
> it seems this touched a raw nerve with you  :) - just don't get mad at chr, im sure he didnt realize that there
> would be issues for visually impaired..

Not a raw nerve per se, but I will say a sensitive 1.  I wasn't mad, just frustrated.  I wanted to use this excellent program & couldn't.  There are so many really excellent programs out there that a person who can't see well (or at all) can't use due to an oversight by the designer.  When a person doesn't have a particular problem, it is very easy to just not see the trees for the forest (not forest for the trees).  :)

> so here's a question for you, in spc, it uses 2 alternative colorings to indicate that an entry is either invalid
> (red) or changed (gree), are those also unreadable, and if so, what would you recommend from a visually
> imparied standpoint, regarding colors..

For my eyes, the higher the contrast between font color & background color the better.  The way I have set up the program for me is:

Normal:               Font = clWhite
                Background = clBlack
Updated:             Font = clYellow
                Background = clNavy
Invalid:                Font = clWhite
                Background = clMaroon

This may not (& doesn't for my son who has similar vision problems) work for someone else, but is extremely effective for me.

But my post wasn't about me.  It was about the fact that the coloring couldn't be changed to take into account these type of problems.

Stepping down from soapbox...

Thanks again for not only the quick changes chr15, but a really nicely done program as well.

Regards
Dragonrider

Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: chr15 on May 24, 2005, 02:02 AM
np KC,

Have fun with it :)
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: Scott on June 29, 2005, 01:04 AM
 
Why does System Path Commander 1.18 change the data type of the Path value from its default of REG_EXPAND_SZ, to REG_SZ?  Windows XP always changes it back to the REG_EXPAND_SZ type, when the System Properties applet is used to edit the Path.
 
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: Scott on June 29, 2005, 06:45 AM
OK, I found out the difference between REG_SZ and REG_EXPAND_SZ, and it's an important one, with very serious applications.  The former does not allow variables to be expanded.  Variable expansion is the whole purpose of REG_EXPAND_SZ.

I also found out that the implications of using the wrong data type can be serious.  I just rebooted after using SPC--without making any actual changes to the path itself--and had serious problems afterward.  (To be clear, what I did was uncheck one of the paths shown in SPC, save the changes, then recheck the path, and save the changes again.  Thus, the path didn't change, but SPC's change was in effect.)  The %SystemRoot% variable wasn't expanded after my reboot, thus instead of being "C:\WINDOWS", it was seen as literally "%SystemRoot%".

Running the command "echo %path%" from a command window shows this.  What I see, after rebooting with a REG_SZ value in place, is:

C:\Program Files\Console;C:\Program Files\UltraEdit;C:\Program Files\Undelete;%SystemRoot%;%SystemRoot%\system32;%SystemRoot%\System32\Wbem;D:\Data\Batch Files

What I should see, and what appears when REG_EXPAND_SZ is used, is:

C:\Program Files\Console;C:\Program Files\UltraEdit;C:\Program Files\Undelete;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS\System32\Wbem;D:\Data\Batch Files

The problems I had included applications that couldn't find supporting files in C:\WINDOWS\system32, and if I let my system lock, it won't let me back in.  I can't even run CHKDSK.EXE normally.  Is this one of those "random features" you talk about?  :o

Sorry I didn't test SPC earlier.  This was my first time using it.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: mouser on June 29, 2005, 07:14 AM
well it seems you found a super important bug;
i will try to contact chr today and get a new version uploaded asap.
until then, as you say the workaround would be to open the control panel and edit the system path and resave, which should reset it.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: Scott on June 29, 2005, 07:39 AM
 
You can't just open System Properties applet and click OK out of it--you need to actually make some sort of change for it to resave the value.  Just make some bogus change (such as adding an "X" to the very end of the path), click OK (actually, click OK twice to be sure; I didn't check to see when System Properties saves changes).  Then go back in and undo the bogus change.

If you want to be sure, open Regedit and navigate to this key to make sure the Path value is of type REG_EXPAND_SZ:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: mouser on June 29, 2005, 02:32 PM
new version (1.20) uploaded with fix:

1.20 - 06/29/05
 bugfix for problem reported by scott on the forum:
   https://www.donationcoder.com/forum/index.php?topic=222.0
   System Path Commander 1.18 changed the data type of the Path value from
   its default of REG_EXPAND_SZ, to REG_SZ, which could cause windows to
   fail to expand path variables like %SystemRoot% - thanks scott!
 new versions of spc will autocorrect this issue when run for the first time.


thanks chr for the super fast fix, and thanks scott for spotting the issue and diagnosing.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: Scott on June 29, 2005, 09:21 PM
Thanks.  Is there any way, with SPC, to add a new entry to the User path, rather than the System path?  (Assuming you're starting with no User path entries at all, so only "SYSTEM.Path" appears in the drop-down list in the first place.)
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: mouser on July 01, 2005, 04:44 AM
scott, chr sent me new version 1.21 that is supposed to do what you are asking. it's up now.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: REDONDOS on August 23, 2005, 12:10 PM
I love it! I've been needing this since I stopped using win9x. I had to browse through a mess of chunk everytime I needed to change my system's path. Thank you, guys.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: mouser on August 23, 2005, 02:09 PM
the only thing this needs that i keep on chr to figure out a trick to solve is that sometimes after you make a change its not reflected in the system right away - it requires either a reboot or easier just go to control panel, click edit path, click ok, to have the system do a little pause and flash and load the new path.
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: zeemar on September 26, 2005, 01:38 PM
It is strange that no body mentioned about the EVE ...stands for Environment Variable Editor
Here is the Link for the software

http://torry.net/apps/utilities/system/eve.zip

Using this all of the system variables can be edited... best of all it is is FREE
Title: Re: DONE - IDEA: modify system path (System Path Commander)
Post by: mouser on September 26, 2005, 01:51 PM
great find zeemar, never heard of that one.
more info on torry's site:
http://www.torry.net/authorsmore.php?id=919

i'll add it to the system path commander help file list of related programs.


ps.
the new versions of system path commander do in fact now update the path immediately after changes.