Sign in to follow this  
Followers 0
realkiller

Remote execute

8 posts in this topic




How to can i remote execute a file in my domain with only a script?

Depending on what you're actually asking, it might be possible:

-Do you want to OPEN a FILE, or EXECUTE a PROGRAM?

-Do you want it to execute on YOUR system or on a REMOTE system in your domain?

-Is the file in question stored on YOUR system or on the REMOTE system?

-Do you have file/share permissions to enable you to do this (that is, are you an administrator)?

If you can't do it without a script, understand that it's unlikely you'll be able to do it WITH a script.


"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

realkiller

I have idea about how make this. With TCPSend() and TCPRecv() functions. When client send some data to server, client execute some program.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Depending on what you're actually asking, it might be possible:

-Do you want to OPEN a FILE, or EXECUTE a PROGRAM?

-Do you want it to execute on YOUR system or on a REMOTE system in your domain?

-Is the file in question stored on YOUR system or on the REMOTE system?

-Do you have file/share permissions to enable you to do this (that is, are you an administrator)?

If you can't do it without a script, understand that it's unlikely you'll be able to do it WITH a script.

iam domain admin,

the the .exe is on my computer and must execute on the remote computer

Edited by realkiller

Share this post


Link to post
Share on other sites

This is exactly what psexec is for.

Share this post


Link to post
Share on other sites

@all

Using WMI you can start a process on a remote computer.

The might get you all going

Dim $objWMIService, $objProcess
Dim $strShell, $objProgram, $strComputer, $strExe, $strInput
$strExe = "Calc.exe"

; Input Box to get name of machine to run the process
Do 
    $strComputer = (InputBox(" ComputerName to Run Script","Computer Name"))
    If $strComputer <> "" Then
    $strInput = 1
    EndIf
Until $strInput = 1 

; Connect to WMI
 $objWMIService = ObjGet("winmgmts://" & $strComputer & "/root/cimv2") 
 
; Obtain the Win32_Process class of object.
$objProcess = $objWMIService.Get("Win32_Process")
$objProgram = $objProcess.Methods_("Create").InParameters.SpawnInstance_()
$objProgram.CommandLine = $strExe 

;Execute the program now at the command line.
$strShell = $objWMIService.ExecMethod("Win32_Process", "Create", $objProgram) 

ConsoleWrite ("Created: " & $strExe & " on " & $strComputer & @CR)
Exit 
; End of Example of a Process Script

Beaware that the process started will not show the GUI on the remote PC !!

Check the Taskmanager to verify the process start.

regards

process

Share this post


Link to post
Share on other sites

WMI is ok to use only if you are running a non-interactive process. For Example, if you run calc.exe on a remote system it will just sit there in the process list but the user cannot see it (the app window that is). I recommend using psexec, it supports interactive processes. I made a gui for PSEXEC here.

Share this post


Link to post
Share on other sites

How to can i remote execute a file in my domain with only a script?

Well, you did ask to do this "with only a script" and WMI might work depending on what remote task you had in mind - but you might want to see the info in the FAQ about XP Home Edition: http://www.autoitscript.com/forum/index.ph...showtopic=37289

Q9. How can I run my script on a remote computer over the network?


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0