2

Possible Duplicate:
How do I set PATH and other environment variables?

In windows (XP) how can I easily append to PATH permanently.

I know that you can change it by going to My Computer -> Properties -> Advanced -> Environment Variables

However since I find myself doing this so often, I'm looking for a faster way.

Ideally it would be an executable or batch file that asks what to append, does the job then disappears.

Any ideas?

AnnanFay
  • 895
  • 3
  • 11
  • 25
  • Everything you need will most probably be covered in there. – slhck Jul 09 '11 at 05:05
  • windows key+pause/break gets as far as properties. if you use setx then be careful to append and not "permanently" wipe your path. – barlop Jul 09 '11 at 21:29

1 Answers1

1

Batch file is the easiest way. Just punch this into a batchfile:

Set /p INPUT= Type the path to append
set PATH = %INPUT%;%PATH%
surfasb
  • 22,452
  • 5
  • 52
  • 77
  • that is not so well done..main problem with that is he'd probably sometimes or often want it permanent as the GUI does, then he'd want setx if doing it from CLI. if he puts in a path that has spaces then it won't work so well, the path would need to be in quotes. Also better to put the appended path AFTER so set path=%path%;.... it's more secure that way I think.. 'cos otherwise a commonly named exe could be sneaked into a non-standard directory and get executed instead of the proper exe. – barlop Jul 09 '11 at 21:47
  • No doubt this is a quick and dirty method, but it fits his specifications, which is, I quote "asks what to append, does the job then disappears." I presumes he knows what he's doing if he's appending a path, as that isn't a run of the mill request. – surfasb Jul 10 '11 at 02:03
  • He wants an alternative to the GUI. The GUI is permanent. So he wants setx or something using setx not set. I don't know what you mean by "presume he knows what he's doing" Mentioning set path=%path% as you do, presumes less knowledge of him than mentioning some details of it and mentioning setx. But set /p is perhaps not quite as well known. – barlop Jul 10 '11 at 09:51