Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Remote Script Execution

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2729
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Remote Script Execution
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Remote Script Execution - 4/18/2005 4:17:51 PM   
  Atanu

 

Posts: 6
Score: 0
Joined: 4/14/2005
From: India
Status: offline
Hi,
I am trying to invoke execution of a vbscript file residing in a remote machine(10.239.33.55) from my machine(10.239.33.58), but i am getting permission denied error everytime. I have admin rights in both the machines. I have also included the Registry entry "Remote" with value=1 in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings for both the machines.

Can anyone help me in this?
------------------------------------------------------------
Codes
------------------------------------------------------------

Dim Controller, RemoteScript
Set Controller = WScript.CreateObject("WSHController")
Set RemoteScript = Controller.CreateScript("D:\SIT-Data\Demo.vbs", "\\10.239.33.55")
WScript.ConnectObject RemoteScript, "remote_"
RemoteScript.Execute

Do While RemoteScript.Status <> 2
WScript.Sleep 100
Loop

WScript.DisconnectObject RemoteScript

Sub remote_Error
Dim theError
Set theError = RemoteScript.Error
WScript.Echo "Error " & theError.Number & " - Line: " & theError.Line & ", Char: " & theError.Character & vbCrLf & "Description: " & theError.Description
WScript.Quit -1
End Sub

--------------------------------------------------------------
please help.

_____________________________

Charged, Recharge and Discharge.....
-Atanu
 
 
Post #: 1
 
 Re: Remote Script Execution - 4/18/2005 4:21:38 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Could you also post Demo.vbs ?

(in reply to Atanu)
 
 
Post #: 2
 
 Re: Remote Script Execution - 4/18/2005 9:51:10 PM   
  Atanu

 

Posts: 6
Score: 0
Joined: 4/14/2005
From: India
Status: offline
Hi token,

Demo.vbs is having only one line that shows a msg as under :-

Demo.vbs
---------------------------------------------------------------------
msgbox "Executed on and at : " & vbnewline & date & vbnewline & time
---------------------------------------------------------------------

(in reply to Atanu)
 
 
Post #: 3
 
 Re: Remote Script Execution - 4/19/2005 6:08:01 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
wsh version on each machine?

(in reply to Atanu)
 
 
Post #: 4
 
 Re: Remote Script Execution - 4/19/2005 9:44:57 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
You can't use msgbox or anything that prints text to the screen.

(in reply to Atanu)
 
 
Post #: 5
 
 Re: Remote Script Execution - 4/19/2005 6:55:36 PM   
  Atanu

 

Posts: 6
Score: 0
Joined: 4/14/2005
From: India
Status: offline
Thanks all,
But i tried it still its not working. I have also set the Remote flag of registry for both the Machines to 1. now, let me tell you the real problem.--

i have an exe on each machines in the network and want to invoke that exes thru a vbs code residing in my machine. For execution in each system, i just need to change the parameters for remote files in the script in my machine. The remote exe can be invoked thru a simple vbs file to be residing in each of these remote machines. this vbs file contains some object creation codes and parameter passing that helps the remote exe to run for different settings.

Can anyone give me a real example of how to do it using any standard exe, say internet explorer. please mention the settings also. Also, note that to invoke the exes i need to invoke the remote scripts residing in the remote machines....

thanks in advance.

(in reply to Atanu)
 
 
Post #: 6
 
 Re: Remote Script Execution - 4/20/2005 12:01:36 AM   
  crazymatt

 

Posts: 296
Score: 0
Joined: 3/4/2005
From:
Status: offline
Im not sure exactly what u wanna do but a great tool for executing script/exes/stuff on a remote machine is psexec, a freeware tool from systernals.
http://www.sysinternals.com/ntw2k/freeware/psexec.shtml

/Matt

(in reply to Atanu)
 
 
Post #: 7
 
 Re: Remote Script Execution - 4/20/2005 1:01:10 AM   
  Atanu

 

Posts: 6
Score: 0
Joined: 4/14/2005
From: India
Status: offline
Hi,
Thanks for the reply. I wanted to say that I need to execute another VBScript file that resides in an remote machine by double clicking on a VBScript file that resides in my machine. May i get a solution for this purely through VBScript.

Anyway, but i am still finding some problems in working with psexec. It is telling System cannot find the specified file repeatedly.
Also, i need a solution through VBScript purely. As Microsoft defines that Remote Script execution can be achieved through VBScript, thats why i would like to see a solution through it. Can you please provide a solution in a way i proposed in my last post?

Thanks in Advance.

(in reply to Atanu)
 
 
Post #: 8
 
 Re: Remote Script Execution - 4/20/2005 4:11:05 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
quote:
Originally posted by kirrilian

wsh version on each machine?


(in reply to Atanu)
 
 
Post #: 9
 
 Re: Remote Script Execution - 4/20/2005 8:45:28 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
quote:
Originally posted by Atanu

Thanks all,
But i tried it still its not working. I have also set the Remote flag of registry for both the Machines to 1. now, let me tell you the real problem.--

i have an exe on each machines in the network and want to invoke that exes thru a vbs code residing in my machine. For execution in each system, i just need to change the parameters for remote files in the script in my machine. The remote exe can be invoked thru a simple vbs file to be residing in each of these remote machines. this vbs file contains some object creation codes and parameter passing that helps the remote exe to run for different settings.

Can anyone give me a real example of how to do it using any standard exe, say internet explorer. please mention the settings also. Also, note that to invoke the exes i need to invoke the remote scripts residing in the remote machines....

thanks in advance.




First of all, if you state your REAL problem in the beginning of the post, that would save a lot of typing and unnecessary quetions. Secondly, if I'm not mistaken, processes created remotely are non-interactive. What that means is that it cannot be used to interact with users; therefore, any output to the stdout or inout from stdin won't work.

In your example of IE, it mostly won't work but you can try. This leaves you with one alternative method of retrieving output, that is, redirect them to a file and read the file afterwards. When you run the remote script, make sure you specify the full path for both the cscript and the secript it self. If you still have problems, please post all relevant codes.

(in reply to Atanu)
 
 
Post #: 10
 
 Re: Remote Script Execution - 4/20/2005 12:10:28 PM   
  CoquitoKing

 

Posts: 20
Score: 0
Joined: 4/20/2005
From: USA
Status: offline
Schtasks.exe

(in reply to Atanu)
 
 
Post #: 11
 
 Re: Remote Script Execution - 4/20/2005 3:54:44 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
huh ?

(in reply to Atanu)
 
 
Post #: 12
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Remote Script Execution Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts