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.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Does the program also run in the same 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 If they are windows programs, you would need to interact with the registry (VBS would be easier for this) to read/write registry entries.

Related Discussions

Related Forums