Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by Jey_P
at 2024-11-19 08:22:40
Point:250 Replies:6 POST_ID:828815USER_ID:10
Topic:
MS DOS;Powershell;VB Script
Hi EE,
I am looking for the scripts or command to ping the list servers that located in domain from text or excel file and get the result in notepad, Could any one help on this? Please and Thank you
Regards,
J Peter
I am looking for the scripts or command to ping the list servers that located in domain from text or excel file and get the result in notepad, Could any one help on this? Please and Thank you
Regards,
J Peter
Assisted Solution
Expert: David Hansen (sl8rz) replied at 2024-11-19 08:51:18
25 points GOOD
You can use MS Powershell to do this (and it's free). Here are a couple of links to show you where people are already doing exactly the same thing you are trying.
http://powergui.org/thread.jspa?threadID=20236
http://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_26672523.html
It is included in the Windows Management Framework download here.
http://powergui.org/thread.jspa?threadID=20236
http://www.experts-exchange.com/Programming/Languages/Scripting/Powershell/Q_26672523.html
It is included in the Windows Management Framework download here.
Assisted Solution
Expert: duncanb7 replied at 2024-11-19 08:49:56
25 points GOOD
it works with less code
@echo off:Startdel -f out.txtREM cd "c:your location if you need"REM ping.txt store all your server namefor /f "tokens=* delims=" %%x in (c:ping.txt) do ping %%x>>out.txtstart notepad.exe "out.txt" 1:2:3:4:5:6:7:
Assisted Solution
Expert: Subsun replied at 2024-11-19 08:42:27
50 points GOOD
Wit PowerShell...
Try..
Try..
GC C:Server.txt | % {$Server = $_ If (Test-Connection $Server -Quiet){ New-Object PSOBJect -Property @{ Server = $Server Status = "UP" } } Else{ New-Object PSOBJect -Property @{ Server = $Server Status = "Down" } }} | Export-Csv C:
eport.csv -nti 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:
Input file..
Expert: duncanb7 replied at 2024-11-19 08:39:56
Hope it will help
@echo off:StartREM cd "c:your location if you need"for /f "tokens=* delims=" %%x in (d:ping.txt) do ping %%xecho.echo. 1:2:3:4:5:6:7:
Assisted Solution
Expert: oBdA replied at 2024-11-19 08:37:05
50 points GOOD
Batch file that creates a csv:
@echo offsetlocalset ServerFile=Servers.txtset LogFile=%~dpn0.csvset CsvDelim=,if exist "%LogFile%" del "%LogFile%"for /f %%a in ('type "%ServerFile%"') do ( echo Processing %%a ... ping -4 -n 4 %%a | find /i "TTL" >NUL if errorlevel 1 ( >>"%LogFile%" echo %%a%CsvDelim%Error echo ... offline. ) else ( echo ... responding. >>"%LogFile%" echo %%a%CsvDelim%Success ))echo Done.start "" notepad.exe "%LogFile%" 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:
Accepted Solution
Expert: sirbounty replied at 2024-11-19 08:35:32
100 points GOOD
From a command line:
for /f %a in (c:servers.txt) do ping %a -n 1 >> results.txt
or in a batch file:
for /f %a in (c:servers.txt) do ping %a -n 1 >> results.txt
or in a batch file: