Execute a BAT File in a remote machine
Hi,
I have a bat file in server2.
I´m on server1 and i want to execute remotly this bat file pp.bat
I execute a vbs file with this code:
strComputer = "pc_name"
Set objWMIService = GetObject ("winmgmts:\\" & strComputer &
"\root\cimv2")
errReturn = objWMIService.Create ("c:\pp.bat", Null, Null,
intProcessID)
Thank you.
--
Agures
Re: Execute a BAT File in a remote machine
On Mon, 19 Feb 2007 18:50:38 +0100, Juanjillo wrote:
> Hi,
>
> I have a bat file in server2.
> I´m on server1 and i want to execute remotly this bat file pp.bat
>
> I execute a vbs file with this code:
>
> strComputer = "pc_name"
> Set objWMIService = GetObject ("winmgmts:\\" & strComputer &
> "\root\cimv2")
> errReturn = objWMIService.Create ("c:\pp.bat", Null, Null,
> intProcessID)
>
>
> Thank you.
Honestly, the fastest and easiest way to do that is to use PSEXEC and it's
free.
--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
VBScript & Windows PowerShell Training -
www.ScriptingTraining.com/classes.asp
Windows PowerShell? - www.SAPIENPress.com/powershell.asp
blog: http://blog.SAPIEN.com
blog: http://jdhitsolutions.blogspot.com
Re: Execute a BAT File in a remote machine
Thank You very much.
I try this.
Best reggards.
> On Mon, 19 Feb 2007 18:50:38 +0100, Juanjillo wrote:
>
>> Hi,
>>
>> I have a bat file in server2.
>> I´m on server1 and i want to execute remotly this bat file pp.bat
>>
>> I execute a vbs file with this code:
>>
>> strComputer = "pc_name"
>> Set objWMIService = GetObject ("winmgmts:\\" & strComputer &
>> "\root\cimv2")
>> errReturn = objWMIService.Create ("c:\pp.bat", Null, Null,
>> intProcessID)
>>
>>
>> Thank you.
>
> Honestly, the fastest and easiest way to do that is to use PSEXEC and it's
> free.
--
Agures
Re: Execute a BAT File in a remote machine
Another good tool for this is BeyondExec (http://www.beyondlogic.org/
solutions/remoteprocess/BeyondExec.htm).
Jack Doyle, Systems Engineer
ScriptLogic Corporation
http://www.scriptlogic.com
Re: Execute a BAT File in a remote machine
> Another good tool for this is BeyondExec (http://www.beyondlogic.org/
> solutions/remoteprocess/BeyondExec.htm).
>
> Jack Doyle, Systems Engineer
> ScriptLogic Corporation
> http://www.scriptlogic.com
Thank You very much.
--
Agures