Experts Exchange connects you with the people and services you need so you can get back to work.
Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.
REM Define files to be used
REM Capture all output to a log file
REM Read each server name from the file
for /F "usebackq tokens=* delims=" %%A in ("%ServerList%") do (
REM Do a basic ping to server to make sure it responds
ping -n 1 -w 250 %%A >nul 2>nul && (
REM Use WMI to get the architecture of the remote server
for /F "tokens=2 delims=, skip=1" %B in ('wmic os get osarchitecture^,version /format:csv') do (
REM Use different command on 64 versus 32 bit OS
if "%%B" == "64-bit" (
psexec \\%%A c:\windows\temp\myexecutable64.exe /q
) else (
psexec \\%%A c:\windows\temp\myexecutable32.exe /q
) || (
REM Ping failed, log as unreachable
echo Server [%%A] not reachable
) >"%LogFile% 2>&1"
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Your question, your audience. Choose who sees your identity—and your question—with question security.