#============================================================================# # Reads in the macros from doskey # =rem $doskey = $ENV{DOSKEY} || (Win32::IsWinNT() ? $ENV{USERPROFILE}.'\doskey.mac' : $ENV{WINDIR}.'\\'.Win32::LoginName.'\doskey.mac'); if (-e $doskey and open IN, $doskey) { ; while () { /^\s*(.*?)=(.*)$/ or next; my ($alias , $cmd) = ($1, $2); $cmd =~ s/\s*\$\*\s*//; $alias{$alias} = $cmd; } close IN; } # =cut #============================================================================# #============================================================================# # Reads in the registered programs from registry # =rem use Win32::Registry; my $HKLM = $HKEY_LOCAL_MACHINE; my $paths; $HKLM->Open('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths', $paths); $paths->GetKeys(\@keys); foreach (@keys) { my $myhash={}; my $reg; $paths->Open($_,$reg); $reg->GetValues($myhash); $alias{lc(substr( $_, 0, -4))} = '"'.$myhash->{''}[2].'"'; } # =cut #============================================================================# 1;