Be Excellent To Each Other

And, you know, party on. Dude.

All times are UTC [ DST ]




Reply to topic  [ 11 posts ] 
Author Message
 Post subject: executing a batch file on a remote computer
PostPosted: Sat Apr 28, 2012 10:07 
User avatar
Isn't that lovely?

Joined: 30th Mar, 2008
Posts: 11168
Location: Devon
I want to double click on an icon on one pc and have it run a batch file on a second pc.

Assuming a standard windows XP install, what's the easiest way to do this?

The other thing I was thinking was using rpc to set up a scheduled task to run 1 minute in the future to run the batch file

Essentially I want to stop a service (easy to do over the network), run 3 cmd lines (which can be in a batch file) and then start the service again.

Thanks

Malc

_________________
Where's the Kaboom? I was expecting an Earth shattering Kaboom!


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Sat Apr 28, 2012 11:54 
User avatar
Excellent Member

Joined: 30th Mar, 2008
Posts: 5924
Location: Stockport - The Jewel in the Ring
Will this work?

http://stackoverflow.com/questions/1878 ... in-windows

_________________
Mint To Be Stationery - Looking for a Secret Santa gift? Try our online shops at Mint To Be.

Book me in the Face | Tweet me. Tweet me like a British nanny.


Top
 Profile  
 
 Post subject: executing a batch file on a remote computer
PostPosted: Sat Apr 28, 2012 12:15 
Awesome
User avatar
Yes

Joined: 6th Apr, 2008
Posts: 12334
Something like

Net use m: //pcname/c$ username password
M:/batchfile.bat
Disconnect M:

I can't remember the exact commands sorry, but mapping a drive with the net use command might help.

_________________
Always proof read carefully in case you any words out


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Sat Apr 28, 2012 12:34 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17161
Location: Just Outside That London, England, Europe
Mr Russell wrote:
Something like

Net use m: //pcname/c$ username password
M:/batchfile.bat
Disconnect M:

I can't remember the exact commands sorry, but mapping a drive with the net use command might help.

Although obviously only applicable if you want the local machine to run the batch files, rather than the remote pc.


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Sat Apr 28, 2012 12:36 
User avatar
Paws for thought

Joined: 27th Mar, 2008
Posts: 17161
Location: Just Outside That London, England, Europe
At work, we use some kind of remote perl thing to do stuff like this.

I've never really got that involved with it, mind, so can't be of any further help on that line.


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Sat Apr 28, 2012 12:41 
User avatar
Isn't that lovely?

Joined: 30th Mar, 2008
Posts: 11168
Location: Devon
Plissken wrote:



I'm using that to stop and start the service, but it's the executing the cmds remotly that I'm stuck on.

Although I have found out how to do it in powershell.

So as long as the first pc has powershell I can make it call the batch file on the 2nd pc

Thanks for the suggestions guys

Malc

_________________
Where's the Kaboom? I was expecting an Earth shattering Kaboom!


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Sat Apr 28, 2012 12:47 
SupaMod
User avatar
Commander-in-Cheese

Joined: 30th Mar, 2008
Posts: 49244
Psexec can do it, I think.

_________________
GoddessJasmine wrote:
Drunk, pulled Craster's pork, waiting for brdyime story,reading nuts. Xz


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Mon Apr 30, 2012 12:53 
Awesome
User avatar
Yes

Joined: 6th Apr, 2008
Posts: 12334
Craster wrote:
Psexec can do it, I think.

Oh yes.

Code:
psexec -i -d \\network-pc03 "C:\batchfile.bat" /accepteula -n 5


should help with eliminating unwanted prompts.

_________________
Always proof read carefully in case you any words out


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Tue May 01, 2012 11:32 
SupaMod
User avatar
Est. 1978

Joined: 27th Mar, 2008
Posts: 69715
Location: Your Mum
...

Didn't Malc start a thread about how you'd hack into a remote computer earlier in the year?

_________________
Grim... wrote:
I wish Craster had left some girls for the rest of us.


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Tue May 01, 2012 12:36 
Awesome
User avatar
Yes

Joined: 6th Apr, 2008
Posts: 12334
If I didn't know who he worked for I'd be worried.

_________________
Always proof read carefully in case you any words out


Top
 Profile  
 
 Post subject: Re: executing a batch file on a remote computer
PostPosted: Tue May 01, 2012 12:38 
User avatar
Ticket to Ride World Champion

Joined: 18th Apr, 2008
Posts: 11897
MI5 just aren't even subtle any more.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Columbo and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search within this thread:
You are using the 'Ted' forum. Bill doesn't really exist any more. Bogus!
Want to help out with the hosting / advertising costs? That's very nice of you.
Are you on a mobile phone? Try http://beex.co.uk/m/
RIP, Owen. RIP, MrC. RIP, Dimmers.

Powered by a very Grim... version of phpBB © 2000, 2002, 2005, 2007 phpBB Group.