³o¨Ç½d¨Ò¬O¦Û¤v®Ú¾Ú¤½¥qªº¤@¨Ç­n¨D©Ò¼gªº,¶È¨Ñ°Ñ¦Ò
«Ø¥ß¤é´Á:2007/10/29
³Ì«á§ó·s:2008/11/24
§@ªÌ:cschen33.tw@yahoo.com.tw
½d¨Ò1:
#comments-start
­×¥¿³Q¯f¬r©Î´c·Nµ{¦¡©Ò­×§ïªº°õ¦æÀÉexeªº©I¥sµ{¦¡ªº¥¿±`µn¿ýÀÉ
­×¥¿HKEY_CLASSES_ROOT\exefile\shell\open\commandªº¹w³]­È"%1" %*
#comments-end
$default_var='"%1" %*'
$var=regread("HKEY_CLASSES_ROOT\exefile\shell\open\command","")
if $var == $default_var Then
   msgbox(64,"°T®§µøµ¡","µ{¦¡exeªºµn¿ýÀɬO¥¿±`ªº")
Else
  $yes_no=msgbox(20,"ĵ§iµøµ¡","µ{¦¡exeªºµn¿ý¤w¸g³Q­×§ï"&@LF&"§A¬O§_­n­×¥¿!")
  if $yes_no==6 then
     regwrite("HKEY_CLASSES_ROOT\exefile\shell\open\command","","REG_SZ",$default_var)
     $var=regread("HKEY_CLASSES_ROOT\exefile\shell\open\command","")
     msgbox(64,"°T®§µøµ¡","­È¤w¸g³Q§ï¬°"&$var)
  EndIf
EndIf

½d¨Ò2:
#comments-start
­×¥¿³Q¯f¬r©Î´c·Nµ{¦¡­×§ïªºTCP/IP¤@¨Ç³]©w­È
­×¥¿HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\ DataBasePath\­È

¬°%SystemRoot%\System32\drivers\etc
#comments-end
$default_var='%SystemRoot%\System32\drivers\etc'
$var=regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","DataBasePath")
msgbox(64,"°T®§µøµ¡",$ var)

if $var == $default_var Then
msgbox(64,"°T®§µøµ¡","µn¿ýÀÉ ¬O¥¿±`ªº")
Else
$yes_no=msgbox(20,"ĵ§i µøµ¡","µn¿ý¤w¸g³Q­×§ï,§A¬O§_­n­×¥¿!")
if $yes_no==6 then
regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","DataBasePath","REG_EXPAND_SZ", $default_var)
$var=regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters","DataBasePath")
msgbox(64,"°T®§µøµ¡","­È¤w¸g ³Q§ï¬°"&$var)
EndIf
EndIf

½d¨Ò3:
#comments-start
USBÂê¦í©Î¸ÑÂê(¥i¤£¥i¥H¨Ï¥Î)
°Ñ¦Òºô¸ô¤Wªº»¡©ú
http://blog.3cbank.com/?p=1004
§Ú­Ì¨Ï¥Îautoit¨ÓÅܦ¨°õ¦æÀÉ,°w¹ï²Ä¤G­Ó­×§ïregister ¤º®e:
#comments-end
$var=RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","Start")
msgbox(4096,"start value",$var)
regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","Start","REG_DWORD",4)
$var=RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","Start")
msgbox(4096,"start value",$var)
#comments-start
§Ú­Ì±NStartªº­È¥Ñ3§ï¬°4´NÂê¦í
¨ä¤¤msgbox¥u¬O½T©w­È¦³³Q§ï¹L,§A¥i¥H¨Ï¥Î¤U­±¤@¦æ´N¥i¥H¤F
regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR","Start","REG_DWORD",4)
½sͬ°°õ¦æÀÉ´N¥i¥H¦b¨Ï¥ÎªÌªº¹q¸£°õ¦æ,´N¥i¥HÂê¦í
¦P¼Ë¸ÑÂê¨Ï¥Î3ªº­È´N¥i¥H¤F
#comments-end
½d¨Ò4:
#³o­Óµ{¦¡¬O¥é¦Ûlinux¤Uªºtmpwatch,¦ý¥u¦³Â²³æ ªº¥\¯à
#§Æ±æ¹ï§A¦³©ÒÀ°§U,³o­Óµ{¦¡¬O©R¥O¦Cªºµ{¦¡
#¼g©ó2007/02/21
#tmpwatch ²Ä¤@­ÓÅܼƬOÀÉ®×¶Z¤µ¶W¹L¦h¤Ö¤ÀÄÁ§R°£,²Ä¤G­ÓÅܼƬOÀɮשҦbªº¸ô®|,²Ä¤T­ÓÅܼƬOÀɦW(¤ä´©*)
#command $cmdline²Ä¤@­ÓÅܼƬO©R¥O¦CÅܼƦ³´X­Ó,²Ä¤G­Ó¥H«á¬°©R¥O¤º®e
#¨Ò¦p:
# tmpwatch 100h c:\windows\temp
# §R°£©Ò¦b¥Ø¿ýc:\windows\temp¤U©Ò¦³¶Z¤µ¶W¹L100¤p®ÉªºÀÉ®×
# tmpwatch 100m c:\windows\temp *.xls
# §R°£©Ò¦b¥Ø¿ýc:\windows\temp¤U©Ò¦³¶Z²{¦b¶W¹L100¤ÀÄÁªºÀÉ®×,¥B°ÆÀɦW¬°xls

#include <File.au3>
#include <Date.au3>
#Include <Array.au3>

$arg=$cmdline[0]
if $arg<2 then
    msgbox(1,"tmpwatch","©Ò´£¨Ñªº°Ñ¼Æ¤£¨¬"&@LF&"1.²Ä¤@­Ó°Ñ¼Æ¬°Àɮפé´Á©M²{¦b®É¶¡ªº®t¶W ¹L¦h¤Ö®É¶¡­n³Q§R °£(«á¥[m(¤ÀÄÁ)©Îh(¤p®É))"&@LF&"2.²Ä¤G­Ó°Ñ¼Æ¥Ø¿ý©Ò¦b"&@LF& "3.²Ä¤T­Ó°Ñ¼Æ¬OÀɦW(¤ä´©*) ")
Else
    $diff=$cmdline[1]
    if stringright($diff,1)="h" or STRINGRIGHT($diff,1)="H" or stringright($diff,1)="m" or stringright($diff,1)="M"  Then
        if stringright($diff,1)="h"or stringright($diff,1)="H" Then
            $diff=stringleft($diff,stringlen($diff)-1)*60
        Else
            $diff=stringleft($diff,stringlen($diff)-1)
        EndIf
    Else
        msgbox(0,"tmpwatch","½Ð¦b®É¶¡«á¥[m(¤À),h(¤p®É)")
        Exit
    EndIf
    $path=$cmdline[2]
    if $arg=3 Then
        $filefilter=$cmdline[3]
    EndIf
    if FileExists($path) Then
        if $arg=2 Then
            $FileList=_FileListToArray($path)
        Else
            $FileList=_filelisttoarray($path,$filefilter)

        EndIf
        _ArrayDelete( $FileList,0)
        $i=0
        If (Not IsArray($FileList))  Then
            MsgBox (0,"°T®§µøµ¡","¥Ø¿ý"&$PATH&"Àɮפ£¦s¦b .",10)
            Exit
        Else
            FOR $element IN $FileList
                $element = $path &"\"& $element

                $t=FileGetTime($element)
                $y = $t[0] &"/"& $t[1] &"/"& $t[2] &" "&$t[3]&":"&$t[4]&":00"
                if  compare_date($y,$diff)Then
                    $I=$I+1
                    FileDelete ( $element )
                Else


                EndIf
            NEXT
            msgbox(0,"","¦@­p:" &$i &" ³Q§R°£",5)
        EndIf

    Else
        msgbox(1,"°T®§µøµ¡","«ü©wªº¸ô®|¤£¦s¦b"&$path)
    endif

endif
func compare_date ($v1,$v2)
    $retvar=0
    if _DateDiff ( 'n', $V1,_NowCalc() )>$v2 Then
        $retvar=1
    EndIf
    return $retvar
EndFunc

½d¨Ò5:
¦P¤W¦ý¬O­«½Æ°õ¦æ,¦ý§R°£ªº¥Ø¿ý¤Î®É¶¡¼g¦bµ{¦¡¤¤,¨Ã«ü©w¹w³]¦Lªí¾÷
#comments-start
 ³o­Óµ{¦¡¬O¥é¦Ûlinux¤Uªºtmpwatch,¦ý¥u¦³Â²³æªº¥\¯à
 §Æ±æ¹ï§A¦³©ÒÀ°§U,³o­Óµ{¦¡¬O©R¥O¦Cªºµ{¦¡
 $diff ¬°¶W¹L¥Ø«e®É¶¡¦h¤Ö¤ÀÄÁªº­n§R°£
 $path ¬°­n©w®É²M°£Àɮ׸ô®|
 $wait ¶¡¹j
#comments-end
#include <File.au3>
#include <Date.au3>
#Include <Array.au3>
#include <Process.au3>
$diff=3
$path="c:\tmp"
$wait=180000
func compare_date ($v1,$v2)
    $retvar=0
    if _DateDiff ( 'n', $V1,_NowCalc() )>$v2 Then
        $retvar=1
    EndIf
    return $retvar
EndFunc
while 1
    if FileExists($path) Then
        $FileList=_FileListToArray($path)
        _ArrayDelete( $FileList,0)
        $i=0
        If (Not IsArray($FileList))  Then
#            MsgBox (0,"°T®§µøµ¡","¥Ø¿ý"&$PATH&"Àɮפ£¦s¦b .",10)
        Else
            FOR $element IN $FileList
                $element = $path &"\"& $element

                $t=FileGetTime($element)
                $y = $t[0] &"/"& $t[1] &"/"& $t[2] &" "&$t[3]&":"&$t[4]&":00"
                if  compare_date($y,$diff)Then
                    $I=$I+1
                    FileDelete ( $element )
                Else


                EndIf
            NEXT
#            msgbox(0,"","¦@­p:" &$i &" ³Q§R°£",5)
        EndIf

    Else
#        msgbox(1,"°T®§µøµ¡","«ü©wªº¸ô®|¤£¦s¦b"&$path)
    endif
$min=@min+3
TraySetToolTip($min&"¤À"&@SEC&"¬í°õ¦æ")    
_RunDos("rundll32  printui.dll,PrintUIEntry /y /n \\mis-server-8\acc-2")
sleep($wait)
WEnd   
½d¨Ò5:
#comments-start
­×¥¿³Q¯f¬r©Î´c·Nµ{¦¡,³y¦¨µLªk³]©wÅã¥ÜÁôÂÃÀÉ
­×¥¿HKEY_LOCAL_MACHINE\Software\Microsoft\windows\CurrentVersion\explorer\ Advanced\Folder\Hidden\SHOWALL","CheckedValue"¹w³]1
#comments-end
$default_var='1'
$var=regread("HKEY_LOCAL_MACHINE\Software\Microsoft\windows\CurrentVersion\explorer\Advanced\Folder\Hidden\SHOWALL","CheckedValue")
if $var == $default_var Then
    msgbox(64,"°T®§µøµ¡","ÁôÂÃÀɵn¿ýÀɬO¥¿±`ªº")
Else
    $yes_no=msgbox(20,"ĵ§iµøµ¡","ÁôÂÃÀɵn¿ý¤w¸g³Q­×§ï,§A¬O§_­n­×¥¿!")
    if $yes_no==6 then
        regwrite("HKEY_LOCAL_MACHINE\Software\Microsoft\windows\CurrentVersion\explorer\Advanced\Folder\Hidden\SHOWALL","CheckedValue",
                       "REG_DWORD",$default_var)
        $var=regread("HKEY_LOCAL_MACHINE\Software\Microsoft\windows\CurrentVersion\explorer\Advanced\Folder\Hidden\SHOWALL","CheckedValue")
        msgbox(64,"°T®§µøµ¡","­È¤w¸g³Q§ï¬°"&$var)
    EndIf
EndIf

½d¨Ò6:
³o­Ó½d¨Ò¬O¶}±Ò¤@­ÓEXCELÀÉ("C:\Program Files\BM7ASampleProgram\BM-7ASample.xls"),«Ø¥ß¤@­Óguiµøµ¡,
¨Ï¥ÎªÌ¥i¥H¿é¤J¨â­Ó­È,«ö°õ¦æ«áµ{¦¡·|«ö¤U¤@­Ó«ö¶s(ª½±µ°õ¦æ¨ä¥¨¶°,¨Ã¤£¬O¨Ï¥Î·Æ¹«ªº±±¨î),
·í°õ¦æ§¹²¦«áµ{¦¡·|Ū¨úexcel ¬Y¤@­ÓÀx¦s®æªº­È(¥¦¦s­ì¿é¥XÀɮתº¸ô®|¦WºÙ(CSV)ÀÉ)
¦b¨ä«á¥[¤J¥Ø«eªº"¤é´Á"©M"®É¶¡"¨âÄæ
#include <GuiConstants.au3>
;Ū¨úexcelÀÉ
;¹w³]:®à­±ªºBM-7ASample.xls
$xls_path="C:\Program Files\BM7ASampleProgram\BM-7ASample.xls"
if WinExists("Microsoft Excel - BM-7ASample") Then
    WinActivate("Microsoft Excel - BM-7ASample")
    $oexcel=ObjGet ( $xls_path )

Else
    $oexcel=ObjCreate("Excel.application")
    with $oExcel
        .Visible = 1
        .Workbooks.open($xls_path,Default)
    EndWith
   
   
EndIf   

;«Ø¥ß¹ï¸Ü®Ø
GuiCreate("BM-7A", 381, 177,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Input_2 = GuiCtrlCreateInput("3", 80, 20, 90, 30)
$Input_3 = GuiCtrlCreateInput("60", 250, 20, 80, 20)
$Button_4 = GuiCtrlCreateButton("½T©w", 150, 90, 90, 30)
$Label_5 = GuiCtrlCreateLabel("´ú¶q¦¸¼Æ:", 20, 20, 60, 20)
$Label_6 = GuiCtrlCreateLabel("¶¡¹j®É¶¡", 190, 20, 60, 30)
$Label_7 = GuiCtrlCreateLabel("’", 340, 20, 20, 20)
$Prog1 = GuiCtrlCreateProgress(80, 130, 220, 30)

GUISETSTATE(@SW_SHOW)

;°j°é
While 1
    $msg = GuiGetMsg()
    $COUNT1=GUICtrlRead($INPUT_2) ;Ū¨ú´ú¶q¦¸¼Æ
    $wait=GUICtrlRead($input_3)*1000 ;Ū¨ú´ú¶q¶¡¹j
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    case $msg=$Button_4
        GUICtrlSetState($input_2,$GUI_DISABLE)
        GUICtrlSetState($INPUT_3,$GUI_DISABLE)
        ;¥ÑexcelÀɨú±oÀx¦sªºÀɮצWºÙÀx¦s®æE4
        $save_file=$oexcel.sheets("BM7ASample").range("E4").text   
        FOR $I=1 TO $COUNT1  STEP 1
            GUICtrlSetData($INPUT_2,$COUNT1-$I)
            GUICtrlSetData($prog1,100*$I/$count1)
            WinActivate("Microsoft Excel - BM-7ASample")
            $oExcel.sheets("BM7ASample").btnMeasure_click()
            WinActivate("Microsoft Excel - BM-7ASample")
            sleep($wait-5000)
            ;Ū¨úÀɮרòM°£¥¼ÀɪºªÅ¥Õ           
            $data=StringStripWS (fileread($save_file),2)
            ;¨ú¥X¸ê®Æ¨Ã¥h±¼ÀɧÀªº´«¦æ
            $data=stringleft($data,stringlen($data))
            ;¦^¼g¼Ò¦¡¬°Âмg
            $csv= fileopen($save_file,2)
            $date1=@YEAR & "/" & @MON & "/" & @MDAY
            $time1=@HOUR & ":" & @MIN & ":" & @SEC
            filewrite($csv,$data & $time1 & "," & $date1 & @CRLF)
            fileclose($csv)   
            sleep(5000)   
        Next
        WinActivate("BM-7A")   
        GUICtrlSetData($prog1,0)
        GUICTRLSETSTATE($INPUT_2,$GUI_ENABLE)
        GUICTRLSETSTATE($INPUT_3,$GUI_ENABLE)
    
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

½d¨Ò7:
¦³¤@­ÓERPªºµ{¦¡¬O¦b¤£¦Pºô¸ô¥D¾÷ªº¤À¨É¸ê®Æ§¨,¤À§O¬°
192.168.0.1,192.168.0.2¤Uªºprog,¦pªG­n¥Î¨ì®É¥²¶·¸ü¤J¬°IºÏºÐ
1.¥ýÀˬd.¬O§_¤w¦s¦b¸Ó¦æµ{
2.¤Á´«I
3.°õ¦æ¸Óµ{¦¡
#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype
#include <Process.au3>
#include <GuiConstants.au3>
IF (ProcessExists("prowin32.exe")) Then
    msgbox(0,"°T®§µøµ¡","¤w¸g¦³¤@­Ó¹ê²±¨t²Î¥¿¦b°õ¦æ!"&@LF&"½ÐÃö³¬«á,¦A°õ¦æ¥»¦¡")
Else   
GuiCreate("¤Á´«I:", 254, 118,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$Label_2 = GuiCtrlCreateLabel("½Ð¿ï¾Ü­n¨Ï¥Îªº¨t²Î", 80, 20, 120, 20)
$Button_1 = GuiCtrlCreateButton("¨t²Î1", 50, 60, 70, 30)
$Button_2 = GuiCtrlCreateButton("¨t²Î2",140,60,70,30)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $Button_1
        _RunDOS("net use i: /delete /yes")
        _RunDOS("net use I: \\192.168.0.1\prog")
        run("C:\dlc91d\bin\prowin32.exe -p login.p -basekey ini -pf temp.pf -param systemtw.cnt -ininame prog800.ini","I:\LC")
        ExitLoop 
    Case $msg = $Button_2
        _RunDOS("net use i: /delete /yes")
        _RunDOS("net use i: \\192.168.0.2\prog")
        run("C:\dlc91d\bin\prowin32.exe -p login.p -basekey ini -pf temp.pf -param systemcn.cnt -ininame prog800.ini","I:\LC")
        ExitLoop
    EndSelect
WEnd
Exit
EndIf
#endregion --- GuiBuilder generated code End ---


½d¨Ò8:
±N¤@­ÓÀÉ®×Âରutf8®æ¦¡¨Ï¥Î§K¶O³nÅéconcmd
¦A±N³o­ÓÀɮסA®Ú¾Ú¥t¤@­Ó¹ï·ÓªíÂà´«¨ä¤º®e
#³oùØ­«ÂI¬O¤Þ¶i¤@­Ó·sªºÀÉ®×=>°}¦C  ,°}¦C=>ÀÉ®×
 
#include <Process.au3>
#Include <File.au3>
$filename = $cmdline[2]
$file = fileopen($filename,0)
if $file = -1 then
   msgbox(0,"¿ù»~","µLªk¶}±ÒÀÉ®×")
   Exit
EndIf
$string1 = fileread($file)
$text = StringReplace($string1, '"', '')
$text=stringleft($text,stringlen($text))
fileclose($file)
$csv= fileopen($filename,2)
filewrite($csv,$text)
fileclose($csv)
$command_line="I:\lc\utl\concmd.exe /i:big5 /o:utf8 " &$filename
$returnvar=_RunDos($command_line)
IF $RETURNVAR == 0 THEN
   MSGBOX(0,"°T®§","ÀÉ®×Âà´«¦¨¥\",2)
Else
   MSGBOX(0,"°T®§","ÀÉ®×Âà´«¦³»~")   
EndIf   

;®Ú¾ÚI:\lc\fin\inc\glsd071.txt
;¼g¤Jc:\ipayment1.txt
; ­ì¦]¸ê®Æ®w¤ºµLªk³B²zutf-8ªº¤¤¤å¦r,(¦³¤@¨Ç¤¤¤å¦r¬O¨Ï¥Îutf-8½s½X,¦pªGÀx¦s¬O¥Hansi¨ÓÀx¦s®É·|Åܦ¨°Ý¸¹
; ¦]¦¹§Ú­Ì¨Ï¥Î¤@­Óutf-8ªº¤å¦rÀɨÓÀx¦sglsd071.txt¨ä½s½X¬°utf-8®æ¦¡¦p¤U
; # ¼t°Ó¥N½X,¼t°Ó¦WºÙ,Åܧó«á¼t°Ó¦WºÙ(¥¿½Tªº)
;¥ý¤@¦æ¤@¦æ¥Ñglsd071.txtŪ¥X
;Àˬd¬O§_ipayment.txt¦s¦b¤W×䪺¼t°Ó¥N½X
;¦pªG¦³«h§ä´M¼t°Ó¦WºÙ,¥HÅܧó«áªº¼t°Ó¦WºÙ(¥¿½Tªº),¨Ó¨ú¥N¼g¤J
;ipayment1.txt
$file_co_trans = FileOpen("I:\LC\FIN\INC\GLSD071.TXT",0)
Dim $alines
IF $file_co_trans = -1 THEN
   MSGBOX(0,'¿ù»~','µLªk¶}±ÒÀÉ®×')   
ENDIF
_FileReadToArray("c:\ipayment.txt",$alines)
while 1
    $read_line1 = FileReadLine($file_co_trans)
    if @error = -1 Then ExitLoop
    if stringmid($read_line1,1,1) <> '#' Then  
       $line_array = StringSplit($read_line1,',')
       if stringlen($line_array[1]) > 0 Then           
            For $x = 1 to $alines[0]
                $read_line2=$alines[$x]
                 if stringmid($read_line2,1,1) = 'P' Then
                   $line2_array=StringSplit($read_line2,',')
                   if $line2_array[11]=$line_array[1] Then
                       msgbox(0,$line_array[1],$line_array[2]& "->" & $line_array[3],2)
                      $alines[$x]=StringReplace($read_line2,$line_array[2],$line_array[3])
                      ;msgbox(0,'©ú²Ó',$alines[$x])
                 
                   EndIf
                EndIf           
            Next
       
        EndIf
    EndIf   
WEnd
fileclose($file_co_trans)
;FileDelete("c:\ipayment.txt")
$target_file = FileOpen("C:\IPAYMENT.TXT",130)
_FileWriteFromArray($target_file, $alines, 1)
fileclose($target_file)
³Ì·s½d¨Ò(2008/11/24)
#include <Process.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("½Ð¿é¤J¶×¤Jªº¦~¤ë(YYYYMM)", 270, 109, 193, 125)
$YYYYMM = @YEAR&@MON
$input1 = GUICtrlCreateInput($YYYYMM, 48, 24, 153, 21)
$Button1 = GUICtrlCreateButton("½T©w", 104, 72, 49, 17, 0)
GUISetState()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Button1
            $result=process_data()               
            ExitLoop
    EndSwitch
WEnd
Func process_data()
GUIDelete($Form1)  ;§R°£¹ï¸Ü®Ø
;¶×¥X¸ê®Æ,³oùجO¿ý»sªº¥Ñricoh 4500,3500,3000¨ú±o²Î­p¸ê®Æ¶×¥X
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Run('"C:\Program Files\RMAdmin\PmAdmin.exe"')
WinWait("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
If Not WinActive("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>") Then WinActivate("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
WinWaitActive("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
Send("{DOWN}{ALTDOWN}t{ALTUP}{DOWN}{DOWN}{ENTER}")
WinWait("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
If Not WinActive("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï") Then WinActivate("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
WinWaitActive("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
Send("{ENTER}")
WinWait("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3000 : 10.10.1.225","¨Ï¥ÎªÌ­¶­p¼Æ")
If Not WinActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3000 : 10.10.1.225","¨Ï¥ÎªÌ­¶­p¼Æ") Then WinActivate("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3000 : 10.10.1.225","¨Ï¥ÎªÌ­¶­p¼Æ")
WinWaitActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3000 : 10.10.1.225","¨Ï¥ÎªÌ­¶­p¼Æ")
Send("{ALTDOWN}f{ALTUP}{ENTER}")
WinWait("¥t¦s¬°","ÀɮצWºÙ(&N):")
If Not WinActive("¥t¦s¬°","ÀɮצWºÙ(&N):") Then WinActivate("¥t¦s¬°","ÀɮצWºÙ(&N):")
WinWaitActive("¥t¦s¬°","ÀɮצWºÙ(&N):")
Send("{ENTER}")
WinWait("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
If Not WinActive("¥t¦s¬°","C:\PRINT_LOG\RICOH_A") Then WinActivate("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
WinWaitActive("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
Send("y")
WinWait("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3000 : 10.10.1.225","¨Ï¥ÎªÌ­¶­p¼Æ")
If Not WinActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3000 : 10.10.1.225","¨Ï¥ÎªÌ­¶­p¼Æ") Then WinActivate("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3000 : 10.10.1.225","¨Ï¥ÎªÌ­¶­p¼Æ")
WinWaitActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3000 : 10.10.1.225","¨Ï¥ÎªÌ­¶­p¼Æ")
Send("{ALTDOWN}{F4}{ALTUP}")
WinWait("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
If Not WinActive("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>") Then WinActivate("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
WinWaitActive("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
Send("{DOWN}{ALTDOWN}t{ALTUP}{DOWN}{DOWN}{ENTER}")
WinWait("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
If Not WinActive("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï") Then WinActivate("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
WinWaitActive("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
Send("{ENTER}")
WinWait("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3500 : 10.10.1.227","¨Ï¥ÎªÌ­¶­p¼Æ")
If Not WinActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3500 : 10.10.1.227","¨Ï¥ÎªÌ­¶­p¼Æ") Then WinActivate("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3500 : 10.10.1.227","¨Ï¥ÎªÌ­¶­p¼Æ")
WinWaitActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3500 : 10.10.1.227","¨Ï¥ÎªÌ­¶­p¼Æ")
Send("{ALTDOWN}f{ALTUP}{ENTER}")
WinWait("¥t¦s¬°","ÀɮצWºÙ(&N):")
If Not WinActive("¥t¦s¬°","ÀɮצWºÙ(&N):") Then WinActivate("¥t¦s¬°","ÀɮצWºÙ(&N):")
WinWaitActive("¥t¦s¬°","ÀɮצWºÙ(&N):")
Send("{ENTER}")
WinWait("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
If Not WinActive("¥t¦s¬°","C:\PRINT_LOG\RICOH_A") Then WinActivate("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
WinWaitActive("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
Send("y")
WinWait("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3500 : 10.10.1.227","¨Ï¥ÎªÌ­¶­p¼Æ")
If Not WinActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3500 : 10.10.1.227","¨Ï¥ÎªÌ­¶­p¼Æ") Then WinActivate("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3500 : 10.10.1.227","¨Ï¥ÎªÌ­¶­p¼Æ")
WinWaitActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C3500 : 10.10.1.227","¨Ï¥ÎªÌ­¶­p¼Æ")
Send("{ALTDOWN}{F4}{ALTUP}")
WinWait("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
If Not WinActive("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>") Then WinActivate("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
WinWaitActive("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
Send("{DOWN}{ALTDOWN}t{ALTUP}{DOWN}{DOWN}{ENTER}")
WinWait("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
If Not WinActive("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï") Then WinActivate("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
WinWaitActive("¿é¤J»{ÃÒ¸ê°T","¿é¤Jµn¤J¸Ë¸mªºµn¤J¨Ï")
Send("{ENTER}")
WinWait("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C4500 : 10.10.1.226","¨Ï¥ÎªÌ­¶­p¼Æ")
If Not WinActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C4500 : 10.10.1.226","¨Ï¥ÎªÌ­¶­p¼Æ") Then WinActivate("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C4500 : 10.10.1.226","¨Ï¥ÎªÌ­¶­p¼Æ")
WinWaitActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C4500 : 10.10.1.226","¨Ï¥ÎªÌ­¶­p¼Æ")
Send("{ALTDOWN}f{ALTUP}{ENTER}")
WinWait("¥t¦s¬°","ÀɮצWºÙ(&N):")
If Not WinActive("¥t¦s¬°","ÀɮצWºÙ(&N):") Then WinActivate("¥t¦s¬°","ÀɮצWºÙ(&N):")
WinWaitActive("¥t¦s¬°","ÀɮצWºÙ(&N):")
Send("{ENTER}")
WinWait("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
If Not WinActive("¥t¦s¬°","C:\PRINT_LOG\RICOH_A") Then WinActivate("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
WinWaitActive("¥t¦s¬°","C:\PRINT_LOG\RICOH_A")
Send("y")
WinWait("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C4500 : 10.10.1.226","¨Ï¥ÎªÌ­¶­p¼Æ")
If Not WinActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C4500 : 10.10.1.226","¨Ï¥ÎªÌ­¶­p¼Æ") Then WinActivate("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C4500 : 10.10.1.226","¨Ï¥ÎªÌ­¶­p¼Æ")
WinWaitActive("¨Ï¥ÎªÌºÞ²z¤u¨ã - RICOH Aficio MP C4500 : 10.10.1.226","¨Ï¥ÎªÌ­¶­p¼Æ")
Send("{ALTDOWN}{F4}{ALTUP}")
WinWait("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
If Not WinActive("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>") Then WinActivate("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
WinWaitActive("SmartDeviceMonitor for Admin - [·j´M¸Ë¸m<IPv4>]","·j´M¸Ë¸m<IPv4>")
Send("{ALTDOWN}{F4}{ALTUP}")
#endregion --- ScriptWriter generated code End ---
;¶×¥X¸ê®Æ

;­×§ï¸ê®Æ
$oexcel=ObjCreate("Excel.application")
$oexcel.Application.DisplayAlerts=False
If @error Then
   MsgBox(0, "Excel Error:", "Error creating Excel object!")
   Exit
EndIf
;²M°£Â¤ë¥÷¸ê®Æ,¸Ñ¨M­«½Æ¶×¤J
 $SQLITE_STRING = 'sqlite3.exe print.db "delete from  print_log where ym =' &$YYYYMM&'"'
 $result=_RunDOS($SQLITE_STRING)
For $j = 1 To 3
    Switch $j
        Case 1       
             ;rd
             $oexcel.Workbooks.open(@ScriptDir&"\RICOH_Aficio_MP_C3000_print.CSV",default)
        case 2
             ;5f
             $oexcel.workbooks.open(@ScriptDir&"\RICOH_Aficio_MP_C3500_print.CSV",default)
         case 3
             ;sales
             $oexcel.Workbooks.open(@ScriptDir&"\RICOH_Aficio_MP_C4500_print.CSV",default)
    EndSwitch                
;$oexcel.Visible = 1
   $oexcel.Sheets(1).Select
   with $oexcel.sheets(1)
       .Rows("1:7").Select
       $oexcel.Selection.Delete
       .Columns("A:A").Select
       $oexcel.selection.delete
       .Columns("B:B").Select
       $oexcel.selection.delete
       .columns("D:N").select   
       $oexcel.selection.delete
       .columns("a:a").select   
       ;$oexcel.selection.replace("[]","'999999")
    switch $j
        case 1
             ;rd
             $oexcel.selection.replace("[]","'900002")
        Case 2
             ;5f
             $oexcel.selection.replace("[]","'900001")
         Case 3
             ;sales
             $oexcel.selection.replace("[]","'900003")
    EndSwitch         
    $oexcel.Selection.Replace("[","'")
    $oexcel.selection.replace("]"," ")

   EndWith
$i=1
$count = 0
while 1
    if $oexcel.cells($i,1).value <> '' Then
       $i = $i +1
       $count = $count + 1     
       switch $j
        case 1
            ;rd  ¤¶©ó0-20³£¬OµØ¯à
            if int($oexcel.cells($count,1).value ) > 0 and int($oexcel.cells($count,1).value) < 30 Then
                  $oexcel.cells($count,1).value = "E" & $oexcel.cells($count,1).value     
            EndIf
        case 2
            ;5f   ½²¹Å­õ ,·|­p®v(888888)
            If int($oexcel.cells($count,1).value) =  7   Then
                $oexcel.cells($count,1).value = "E" & $oexcel.cells($count,1).value       
            EndIf                           
        case 3
            ;sales ±i¯E²» ¼B«H½Ë
            If int($oexcel.cells($count,1).value) =  8 or int($oexcel.cells($count,1).value) =  22 Then
                $oexcel.cells($count,1).value = "E" & $oexcel.cells($count,1).value       
            EndIf               
        EndSwitch         
       ;msgbox(1,'test',$oexcel.cells($count,1).value)      
       $oexcel.cells($count,4).value = "'" & $YYYYMM
      
    Else
          Exitloop  
    EndIf   
WEnd   
$oexcel.ActiveWorkbook.Save
$oexcel.quit
switch $j
    case 1
         
        $SQLITE_STRING = 'sqlite3.exe -separator "," print.db ".import RICOH_Aficio_MP_C3000_print.CSV print_log"'
    case 2
        $SQLITE_STRING = 'sqlite3.exe -separator "," print.db ".import RICOH_Aficio_MP_C3500_print.CSV print_log"'
    case 3
        $SQLITE_STRING = 'sqlite3.exe -separator "," print.db ".import RICOH_Aficio_MP_C4500_print.CSV print_log"'
EndSwitch      
;¶×¤J¸ê®Æ¨ìsqlite¸ê®Æ®w
$result=_RunDOS($SQLITE_STRING)
Next
;¶×¤Jcsvªº«ü¥O
;sqlite3.exe -separator "," print.db ".import ricoh_aficio_mp_c3000_print.csv print_log;"
MSGBOX(0,"°T®§","¶×¤J¸ê®Æ§¹²¦")
 exit
EndFunc   

¨Ï¥Î¨ç¦¡»¡©ú:
  1. Ū¨úµn¿ýÀÉ
  2. ¼g¤Jµn¿ýÀÉ
  3. °T®§¹ï¸Ü®Ø¦p¦ó´«¦æ
  4. ¨ú±o©R¥O¦C°Ñ¼Æ
  5. ¨ú±o¨Ï¥ÎªÌ®à­±ªº¸ô®|
  6. ¨ú±o¥Ø«e®É¶¡¤é´Á
  7. ¶}±ÒEXCELÀÉ
  8. °õ¦æEXCEL¥¨¶°
  9. ¨ú±o EXCELÀx¦s®æªº­È'
  10. GUIµe­±³]©w
  11. ³]©w¦Lªí¾÷
  12. Àˬd¦æµ{¦s¦b¤£¦s¦b¤Î±Ò°ÊªA°È
  13. ±`¾nµ{¦¡ªº´£¥Ü¥\¯à,autoit3¥u­n¨Ï¥Îloop¨ä¦æ¬°´N¥i¥H¹³±`¾nµ{¦¡
  14. ¦bÀɮ׳̫á¤@¦æ¥[¤J¸ê®Æ (autoit¥u¦³³æ¦æ¼g¤J¥\¯à,¦æ§À·|¥[¤J´«¦æ²Å¸¹,¦]¦¹µLªk¦b­ì¥»ªº¦æ§À¥[¤J¸ê®Æ)
  15. ¼Ò ÀÀ¿é¤J

autoit 3 ªº·s¥\¯àcontrol
¥H«e¦b¼ÒÀÀ¿é¤J·|¦³¤@­Ó¤jªº°ÝÃD,µLªk«Üºë½Tªº¿é¤J,²{¦b¥[¤Jªº control¥i¥Hª½±µ¿é¤J¨ì¬Y­Óclass¤º
§A¥i¥H¨Ï¥Îautoit windows  info ¨Ó¬d¬Ý¨äclasses
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",1)
Opt("WinDetectHiddenText",1)
$title1="¼Ð·Ç¨t²Î ADMIN "  & @YEAR & '/' & @MON & '/' & @MDAY  & ' (µØ¿³)'
$title2="ADMIN  SYSA850  ¡m¡°  ©w®É§å¦¸§@·~  ¡°¡n  C  " & @YEAR & '/' & @MON & '/' & @MDAY  & ' (µØ¿³)'

run("c:\dlc91d\bin\prowin32.exe -p login.p -basekey ini -pf temp.pf -param systemtw.cnt ","i:\lc")
If Not WinActive("¼Ð·Ç¨t²Î","Cancel") Then WinActivate("¼Ð·Ç¨t²Î","Cancel")
WinWaitActive("¼Ð·Ç¨t²Î","Cancel")
Send("admin{TAB}passwd{ENTER}")
WinWaitActive($title1)
sleep(2000)
ControlSend($title1,'',"[CLASS:Edit; INSTANCE:2]","sysa850")
Send('{enter}')
sleep(1000)
Send("y")
sleep(1000)
ControlSend($title2,'',"[CLASS:Edit; INSTANCE:18]","002")
sleep(1000)
ControlSend($title2,'',"[CLASS:Edit; INSTANCE:10]","20081231")
sleep(1000)
ControlSetText($title2,'',"[CLASS:Edit; INSTANCE:8]","2000")
sleep(1000)
send("{F2}")


»¡©ú:
controlsend()  ¦b­ì¦³ªº¤å¦r¤Wªþ¥[(¥i¯à¤§«e¥i¯à¤§«á)
controlsetText()   ¨ú¥N­ì¦³¤å¦r