ãããã¯ããã©ã«ãã®ã«ã¹ã¿ãã¤ãºã使ã£ã¦ããã©ã«ãã«ããããç¬ç¹ã®ã¢ã¤ã³ã³ãã¤ããããã«ãã¦ãã¾ããã½ããã®ãã©ã«ãã ã£ããããã®ã½ããã®ã¢ããªã±ã¼ã·ã§ã³ã¢ã¤ã³ã³ãè¨å®ãã¦ãããªã©ããã¨ããã¨ãã°ãªã³ã©ã¤ã³ã½ããæ ¼ç´ãã©ã«ããªãã¦ã®ã¯ããªãè¦ããããªããå¤å°ããã©ã¼ãã³ã¹ãç ç²ã«ãªãããããã¾ããããè¦ãããã®ã«è¶ãããã¨ã¯ãªãã§ããã
ãã ãããã§ã¯æ¯åº¦æ°ããã½ãããå
¥ãããã³ã«å¤§å¤ãªã®ã§ãã©ãã«ãã§ããªããã¨æã£ãã®ã§ããç´ä¸ã®exeãã¡ã¤ã«ã®ã¢ã¤ã³ã³ãèªåçã«è¨å®ããããããªDesktop.iniãèªåçæãã¦ãããã°ããã®ã«ã
ã¨ããããã§ä½ã£ã¦ã¿ã¾ãããPerlã¹ã¯ãªãããªã®ã§ActivePerlãå¿
è¦ã§ãã
use Win32::File; my $dir = shift @ARGV; my @exes; my $exename; # \æ«ç«¯ã§çµãããªãããã«ãã $dir =~ s/\\$//; chdir $dir; # ãã£ã¬ã¯ããªå ã®EXEåæ while(<*.exe>) { push(@exes, $_); } # ãã£ã¬ã¯ããªå ã®ICOåæ(JAVAã®ã½ãããªã©ãå®è¡ãã¡ã¤ã«ããªãå ´åã®ãã) while(<*.ico>) { push(@exes, $_); } # exeæ¤ç´¢ if(scalar @exes == 1) { # ã¢ã¤ã³ã³ãæã£ã¦ããã®ãä¸ã¤ãããªã $exename = shift @exes; }elsif(@exes){ # ã¢ã¤ã³ã³ãæã£ã¦ããã®ãè¤æ°ãé¸æããã print "what are you select icon file?\n"; foreach my $i(0..$#exes) { print "$i = $exes[$i]\n"; } print "input number:"; $exename = $exes[<STDIN>]; print "this is unknown" unless $exename; }else{ # ã¢ã¤ã³ã³ãæã£ã¦ããã®ããªã print "icon file not found\n"; } # Desktop.iniä½æ if($exename) { print "you'r select $exename\n"; open INI, ">Desktop.ini"; print INI "[.ShellClassInfo]\n"; print INI "IconFile=$dir\\$exename\n"; print INI "IconIndex=0\n"; close INI; # 表示ã§ããããã«å±æ§å¤æ´ Win32::File::SetAttributes("Desktop.ini", Win32::File::HIDDEN); Win32::File::SetAttributes(".", Win32::File::READONLY); }
ãããã©ããã«ä¿åãã¦ãSendToãã©ã«ãã«ã·ã§ã¼ãã«ããã§ãä½ã£ã¦ããã°ããéããããç°¡åã«ã¢ã¤ã³ã³ãè¨å®ã§ãã¾ããããã³ããã®è±èªã®æå³ãªã©ããªããã¡ããã¡ãã ã¨æãã¾ããæ°ã«ããªãã§ãã ãã(^_^;
æå¾ã®Win32::File::SetAttributes(".", Win32::File::READONLY);
ã«ã¤ãã¦ãã¡ãã£ã¨æ©ãã ãã§ãããã©ããããããªãã¨ãDesktop.iniã«ä½ãæ¸ãã¦ãç¡è¦ããã¦ãã¾ããã¨ãããã¨ã§ããããããããéµã«ãªã£ã¦ãã®ã§ãããã
æè¿Perlãã¦ã¼ãã£ãªãã£ç¨éã«ä½¿ããã¨ãå¤ããªã£ã¦ãã¾ãããã¨ããããããã¦ãã®ãã®ã¯ããã£ã¦ãã®ã§ããããã¨æãã°ãããããã¨ãããã§ãããããã¡ã¤ã«ã®åæãªã©ãç°¡åã«ã§ããã®ã§ä½¿ãããããããã¹ãå
¥åæ¯æ´ã½ãããªããã«ããã®åãããã¨ããã§ããã