Question

Locked

How do you modify the Win32 PATH statement in a Perl script?

By Miyamoto Musashi ·
I have been all over Google searching for this answer and I have yet to come across something substantial that addresses this piece.

What I need to do is have my perl script add/modify the windows path statement to include a few directories that are required to run programs ONLY during the execution of the perl script.

I.E.: Program 123.exe is located in C:\123\ and program 456.exe is located in C:\Program Files\456\. I do not want the path for either 123.exe and 456.exe to be globally available.

Thanks in advance.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Does the program also run in the same command.com memory space?

by robo_dev In reply to How do you modify the Win ...

If so, why not just make a shortcut to cmd and adjust the "start in" properties of the shortcut? By setting the 'start-in' explicitly, the script will find the other executables.

This would allow the perl script to find the other programs, and you would not need to modify the path.

There's a big difference if your 'programs' are DOS programs or Windows programs. If they are DOS, you need to set environment as part of invoking command.com. If they are windows programs, you would need to interact with the registry (VBS would be easier for this) to read/write registry entries.

http://windowsitpro.com/article/articleid/23932/rem-changing-environment-variables-in-perl-scripts.html

Back to Google Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums