We help IT Professionals succeed at work.

PSEXEC on Subnet or vLAN

Hello,

I run the below command on a bunch on computers on a text file:
psexec @computers7.txt -c -f -s -d -u domain\user -p password \\server\folder\file.bat

Open in new window


Is there anyway to run it on a subnet like 192.168.5.x ?

Thanks
Comment
Watch Question

BRONZE EXPERT
Commented:
You can try something like this:
for a = 1 to 254
psexec \\192.168.5.a -c -f -s -d -u domain\user -p password \\server\folder\file.bat
next a

Open in new window

or
cmd.exe:
for /L %x in (1,1,254) do psexec \\192.168.5.%x -c -f -s -d -u domain\user -p password \\server\folder\file.bat

Open in new window

Author

Commented:
Wanna see the progress, the 1st file be a .bat?

Author

Commented:
for /L %x in (1,1,254) do psexec \\192.168.5.%x -c -f -s -d -u domain\user -p password \\server\folder\file.bat

Open in new window


Seems good, however how can I reduce the time while connecting to each IP?

Author

Commented:
-n time in seconds is the solution, Thanks