יש לי קוד של VBS שמיועד לביצוע PING לכמה מחשבים בו זמנית
והוא פותח קובץ אקסל כאשר אני מריץ את ה VBS שלי
יש מצב שמישהו יכול לעזור לי אם הקוד הזה ואני רוצה שהתוכנה לא תפתח אלה הוא ישמור את הקובץ אקסל בתיקיה וגם שאני לא יראה אותו נפתח אלה שיהיה הכל מאחורי הלקעים
(הצלחתי לשנות שם את הנתון של VISIBLE ל FALSE אבל עכישו אני לא רואה בכלל שהוא נפתח ואין לי איך לשמור)
הכי חשוב שיהיה אם הקובץ כבר קיים שיעשה שם שונה או יוסיף 1 או 2 משהו כזה שישכפל לי קבצים
מישהו יכול לעזור לי בבקשה? ותודה מראש :-)
הקוד עצמו:Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
intRow = 2
objExcel.Cells(1, 1).Value = "Machine Name"
objExcel.Cells(1, 2).Value = "Results"
Set Fso = CreateObject("Scripting.FileSystemObject")
Set InputFile = fso.OpenTextFile("MachineList.Txt")
Do While Not (InputFile.atEndOfStream)
HostName = InputFile.ReadLine
Set WshShell = WScript.CreateObject("WScript.Shell")
Ping = WshShell.Run("ping -n 1 " & HostName, 0, True)
objExcel.Cells(intRow, 1).Value = HostName
Select Case Ping
Case 0 objExcel.Cells(intRow, 2).Value = "On Line"
Case 1 objExcel.Cells(intRow, 2).Value = "Off Line"
End Select
intRow = intRow + 1
Loop
objExcel.Range("A1:B1").Select
objExcel.Selection.Interior.ColorIndex = 19
objExcel.Selection.Font.ColorIndex = 11
objExcel.Selection.Font.Bold = True
objExcel.Cells.EntireColumn.AutoFit