- ©«¤l
- 14
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 50
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ©yÄõ
- µù¥U®É¶¡
- 2013-8-26
- ³Ì«áµn¿ý
- 2013-12-19
|
¦^´_ 2# luhpro
¤Q¤À·PÁ¡I¤w¸g¥i¥H¨Ï¥Î¡A¦ýµ{¦¡¹L©ó¤¾ªø¡A¤£ª¾¬O§_¯à°÷¥[¥H§ï¶i¡AÁÂÁ¡I
°²³] a1¦Üa10Àx¦s®æ¤º®e¤À§O¬°100.11.12.1¦Ü10¡Aping§¹«á¡A±Nµ²ªG¼g¦ÜB1¦ÜB10¡Aµ{¦¡¦p¤U¡G
Sub iptest()
Columns("B:C").Select
Selection.ClearContents
'«Ø¥ß´ú¸Õip§å¦¸ÀÉ®×
¸ô®| = ThisWorkbook.Path & "\"
For ¦C = 1 To 10
ÀɦW = ¸ô®| & ¦C
¤º®e = "Ping -n 1 " & Cells(¦C, 1) & " > " & ÀɦW & ".txt"
Open ÀɦW & ".bat" For Output As #1
Print #1, ¤º®e
Close #1
Next ¦C
¶O®É = Timer
'´ú¸Õip
For ¦C = 1 To 10
§å¦¸ÀÉ = ¸ô®| & ¦C & ".BAT"
A = Shell(§å¦¸ÀÉ, 0)
Next ¦C
¥ð®§ = Timer
Do While Timer - ¥ð®§ < 4
Loop
'Ū¨úµ²ªG
¨t²Î = Application.OperatingSystem
For ¦C = 1 To 10
¤å¦rÀÉ = ¸ô®| & ¦C & ".TXT"
¥N½X = FreeFile ' ¨ú±o¥¼¨Ï¥ÎªºÀÉ®×¥N½X¡C
Open ¤å¦rÀÉ For Input As #¥N½X
If Left(Right(¨t²Î, 4), 1) = 5 Then ¦r = LOF(¥N½X) Else ¦r = 80
Cells(¦C, 2) = Input(¦r, #¥N½X)
Close #¥N½X ' Ãö³¬ÀɮסC
Next ¦C
[c1] = Timer - ¶O®É
[a1].Select
¥ð®§ = Timer
Do While Timer - ¥ð®§ < 4
Loop
Kill ¸ô®| & "*.BAT"
Kill ¸ô®| & "*.TXT"
End Sub |
|