Dos Script Multiple computers

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Andy80
Posts: 3
Joined: 19 Apr 2012 03:42

Dos Script Multiple computers

#1 Post by Andy80 » 19 Apr 2012 04:02

Hi im wondering how to best write a dos script that takes computer from a file and runs a bat file on that computer remotely
how would i write it to load the file and take each computer and run the task on em and is it possible to do if the computer name isnt reponding that the script pings the computer and run the ip adress instead.

Many thanks Andreas

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Dos Script Multiple computers

#2 Post by abc0502 » 19 Apr 2012 04:34

sorry i'm confused
what do u wan't to do?
to run any command or program remtly u have to get permissions first like if u are the admin of a croup of computer

Andy80
Posts: 3
Joined: 19 Apr 2012 03:42

Re: Dos Script Multiple computers

#3 Post by Andy80 » 19 Apr 2012 04:41

Hi yes i have the access for running the script, but what i want is to put a list of computers in a file and have then have dos load the computers names and remotely copy over the bat file i created and then run it on the computer.
Basicly i have the dos script on a group disk and i want my other dos script run on my computer then load all the computers names i have put in a file then copy my fix over to all the computer then run it i have the client side fix rdy.

Thanks Andreas

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Dos Script Multiple computers

#4 Post by foxidrive » 19 Apr 2012 05:03

One of the PS tools from Microsoft/sysinternals can help you.

Google for psexec

Andy80
Posts: 3
Joined: 19 Apr 2012 03:42

Re: Dos Script Multiple computers

#5 Post by Andy80 » 19 Apr 2012 08:53

im more intrested in knowing how to get the dos script to load from a txt files computer names so i can just put in 100 computer and run it so it copys my fix over to the users computers.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: Dos Script Multiple computers

#6 Post by Squashman » 19 Apr 2012 09:28

Andy80 wrote:im more intrested in knowing how to get the dos script to load from a txt files computer names so i can just put in 100 computer and run it so it copys my fix over to the users computers.

You have a few options for running a Batch file remotely on computers.
1) Push it down with a Domain Policy
2) As Foxi said, you can do it with PSEXEC as well.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Dos Script Multiple computers

#7 Post by foxidrive » 19 Apr 2012 10:32

Andy80 wrote:im more intrested in knowing how to get the dos script to load from a txt files computer names so i can just put in 100 computer and run it so it copys my fix over to the users computers.


Like this?

Code: Select all

@echo off
(
echo computerone
echo computertwo
echo computerthree
)>file.txt
for /f "delims=" %%a in (file.txt) do echo run my script with %%a

Post Reply