http://www.perlmonks.org?node_id=321350


in reply to Quickest way to locate System32 Dir?

System32 directory is almost always in the System root directory. In windows NT/2000/XP/2003 the path to the system32 is always SystemRoot\system32, where SystemRoot is in the ENV hash. When I run this:
C:\>perl -e "@keys = keys(%ENV); foreach $key (@keys){print qq/$key = $ENV{$key} \n/;};"

I show SYSTEMROOT such:

... SYSTEMDRIVE = C: PROCESSOR_REVISION = 0806 SYSTEMROOT = C:\WINNT COMSPEC = C:\WINNT\system32\cmd.exe ...
I cannot be sure if this is true on Win9x systems (I believe it is).

update: grammar repair.

MADuran
In need of a spiffy sig