For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > April 2005 > Re: Edit Windows PATH









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Edit Windows PATH
Chris Devers

2005-04-27, 3:56 pm

On Fri, 1 Jan 1988, amr wrote:

> Do we have Perl script that can edit & add to the Windows (XP, 2000) path.?


Is there a reason that a simple system() command won't work here?

my $status = system( "SET PATH=%PATH%;$new_path" );
die "Couldn't set %PATH%: $!" if $status;

Normally I'm opposed to using system commands when the task can be done
either all in Perl or with a platform- and problem- specific module, but
in this case, the cmd shell's SET command is easy to run directly, so
why not just solve the problem that way?


--
Chris Devers
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com