nitro322 Posted April 9, 2005 Share Posted April 9, 2005 I've written a helper script that I can use when installing applications to automatically update the system path (if necessary). Useful for installng CLI programs such as nmap. Anyway, setting the path in NT is easy: update the regkey and call envupdate(). Perfect, everytime (and THANK YOU to whoever wrote that function :-). 9x is tricker, though. Based on my research, it seems that updating it through autoexec.bat is the best and most reliable way of doing it. So, I scripted that, and have that working perfectly after a reboot. However, I'd like to enable Win9x users to use the program without a reboot, just like NT users can do. Is there any way to do this? envupdate() doesn't update the path on 9x (at least not through autoexec.bat), and I haven't been able to figure out any other way to do this. Any suggestions? Thanks! http://www.legroom.net/ Link to comment Share on other sites More sharing options...
bshoenhair Posted April 10, 2005 Share Posted April 10, 2005 Only way I know of is: Use at own risk of cource ProcessClose('explorer.exe') Sleep(2000) If Not ProcessExists('explorer.exe') Then Run('explorer.exe') Link to comment Share on other sites More sharing options...
nitro322 Posted April 10, 2005 Author Share Posted April 10, 2005 Wow. Umm, looks effective, but are there any other, maybe less extreme, suggestions? :-) http://www.legroom.net/ Link to comment Share on other sites More sharing options...
kloyenz Posted April 10, 2005 Share Posted April 10, 2005 yes simply update the autoexec.bat and run it in windows and thats it :-) Link to comment Share on other sites More sharing options...
nitro322 Posted April 10, 2005 Author Share Posted April 10, 2005 kloyenz, what do you mean by run it in Windows? If I do that, the new path only gets applied to the local shell that it's run from. Windows itself, on a global level, still doesn't know about the changes. Is there some special way I can run autoexec.bat to make it apply globally? http://www.legroom.net/ Link to comment Share on other sites More sharing options...
major4579 Posted April 10, 2005 Share Posted April 10, 2005 nitro322, There's a program on the W98 CD called winset.exe. This can be used to set global environmental variables. I seem to remember having to run the set command first - but I'm not sure. It would look something like: set path=%path%;newpath winset path=%path%;newpath it's worth a try.. Link to comment Share on other sites More sharing options...
nitro322 Posted April 10, 2005 Author Share Posted April 10, 2005 (edited) There's a program on the W98 CD called winset.exe. This can be used to set global environmental variables.<{POST_SNAPBACK}>This is perfect! I've never heard of this program before, but it does exactly as you said. Rock on.Any chance this capability could be added to the envupdate function? Or built into AutoIt in some other way? It'd be nice not to have to deal with an extra executable.Either way, though, I'm quite happy right now. :-) Thanks again. Edited April 10, 2005 by nitro322 http://www.legroom.net/ Link to comment Share on other sites More sharing options...
nitro322 Posted April 10, 2005 Author Share Posted April 10, 2005 Ok, it's not perfect. It does apply the new path to all future processes, but still not explorer.exe itself. So, if I launch a new command prompt, then it works. However, if I try to run the command from explorer itself (or and application that gets the path directly from explorer), then it fails. Sigh, so close... But, this will still work well enough. I need this functionality for 6 applications, and only 1 of them still fails. I'll just force a reboot on that one. Anyway, thanks again. http://www.legroom.net/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now