mrrlg Posted February 7, 2005 Share Posted February 7, 2005 I am attempting to script a solution to the following problem. I need to be able to log onto remote servers and open a dos prompt on that remote server for the purpose of running an exacutable. I was able to write the script up to the point of opening the dos window on the remote machine. I would like to script it so it would select the name of the server entered eariler in the script (by using an input box) so I can use one script for many machines. When I use: Run(@SystemDir & '\cmd') it opens the dos window on my machine, not the dos window on the remote machine. How can I edit this command to accomplish this? Is there a way to insert the contents of an InPutBox into this command? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 7, 2005 Developers Share Posted February 7, 2005 I am attempting to script a solution to the following problem. I need to be able to log onto remote servers and open a dos prompt on that remote server for the purpose of running an exacutable. I was able to write the script up to the point of opening the dos window on the remote machine. I would like to script it so it would select the name of the server entered eariler in the script (by using an input box) so I can use one script for many machines.When I use:Run(@SystemDir & '\cmd')it opens the dos window on my machine, not the dos window on the remote machine. How can I edit this command to accomplish this? Is there a way to insert the contents of an InPutBox into this command?<{POST_SNAPBACK}>To run a command on a remote machine, you might want to look at PSEXEC from sysinternals..... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
mrrlg Posted February 8, 2005 Author Share Posted February 8, 2005 To run a command on a remote machine, you might want to look at PSEXEC from sysinternals.....<{POST_SNAPBACK}>Have you tried integrating this with AutoIt? Link to comment Share on other sites More sharing options...
Andre Posted February 8, 2005 Share Posted February 8, 2005 Use FileInstall to 'integrate' it in AutoIt Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
Andre Posted February 8, 2005 Share Posted February 8, 2005 Here u are.usage: psexec [\\computer[,computer[,..] | @file ][-u user [-p psswd]][-n s][-s|-e][-i][-c [-f|-v]][-d][-w directory][-<priority>][-a n,n,...] cmd [arguments]computerDirect PsExec to run the application on the computer or computers specified. If you omit the computer name PsExec runs the application on the local system and if you enter a computer name of "\\*" PsExec runs the applications on all computers in the current domain.@fileDirects PsExec to run the command on each computer listed in the text file specified.-aSeparate processors on which the application can run with commas where 1 is the lowest numbered CPU. For example, to run the application on CPU 2 and CPU 4, enter: "-a 2,4"-cCopy the specified program to the remote system for execution. If you omit this option then the application must be in the system's path on the remote system.-dDon't wait for application to terminate. Only use this option for non-interactive applications. -eLoads the specified account's profile.-fCopy the specified program to the remote system even if the file already exists on the remote system.-iRun the program so that it interacts with the desktop on the remote system.-nSpecifies timeout in seconds connecting to remote computers.-pSpecifies optional password for user name. If you omit this you will be prompted to enter a hidden password.-sRun remote process in the System account .-uSpecifies optional user name for login to remote computer.-vCopy the specified file only if it has a higher version number or is newer on than the one on the remote system.-wSet the working directory of the process (relative to the remote computer).-prioritySpecifies -low, -belownormal, -abovenormal, -high or -realtime to run the process at a different priority.programName of the program to execute.argumentsArguments to pass (note that file paths must be absolute paths on the target system)You can enclose applications that have spaces in their name with quotation marks e.g. "psexec \\marklap "c:\long name\app.exe". Input is only passed to the remote system when you press the enter key, and typing Ctrl-C terminates the remote process.If you omit a username the remote process runs in the same account from which you execute PsExec, but because the remote process is impersonating it will not have access to network resources on the remote system. When you specify a username the remote process executes in the account specified, and will have access to any network resources the account has access to. Note that the password is transmitted in clear text to the remote system.ExamplesThis article I wrote describes how PsExec works and gives tips on how to use it:http://www.winnetmag.com/Windows/Issues/Is.../714/Index.htmlThe following command launches an interactive command prompt on \\marklap: psexec \\marklap cmdThis command executes IpConfig on the remote system with the /all switch, and displays the resulting output locally: psexec \\marklap ipconfig /allThis command copies the program test.exe to the remote system and executes it interactively: psexec \\marklap -c test.exeSpecify the full path to a program that is already installed on a remote system if its not on the system's path: psexec \\marklap c:\bin\test.exeRun Regedit interactively in the System account to view the contents of the SAM and SECURITY keys:: psexec -i -d regedit.exePsToolsPsExec is part of a growing kit of Sysinternals command-line tools that aid in the adminstration of local and remote Windows NT/2K systems named PsTools.Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
afsar Posted August 19, 2005 Share Posted August 19, 2005 Here u are.usage: psexec [\\computer[,computer[,..] | @file ][-u user [-p psswd]][-n s][-s|-e][-i][-c [-f|-v]][-d][-w directory][-<priority>][-a n,n,...] cmd [arguments]computerDirect PsExec to run the application on the computer or computers specified. If you omit the computer name PsExec runs the application on the local system and if you enter a computer name of "\\*" PsExec runs the applications on all computers in the current domain.@fileDirects PsExec to run the command on each computer listed in the text file specified.-aSeparate processors on which the application can run with commas where 1 is the lowest numbered CPU. For example, to run the application on CPU 2 and CPU 4, enter: "-a 2,4"-cCopy the specified program to the remote system for execution. If you omit this option then the application must be in the system's path on the remote system.-dDon't wait for application to terminate. Only use this option for non-interactive applications. -eLoads the specified account's profile.-fCopy the specified program to the remote system even if the file already exists on the remote system.-iRun the program so that it interacts with the desktop on the remote system.-nSpecifies timeout in seconds connecting to remote computers.-pSpecifies optional password for user name. If you omit this you will be prompted to enter a hidden password.-sRun remote process in the System account .-uSpecifies optional user name for login to remote computer.-vCopy the specified file only if it has a higher version number or is newer on than the one on the remote system.-wSet the working directory of the process (relative to the remote computer).-prioritySpecifies -low, -belownormal, -abovenormal, -high or -realtime to run the process at a different priority.programName of the program to execute.argumentsArguments to pass (note that file paths must be absolute paths on the target system)You can enclose applications that have spaces in their name with quotation marks e.g. "psexec \\marklap "c:\long name\app.exe". Input is only passed to the remote system when you press the enter key, and typing Ctrl-C terminates the remote process.If you omit a username the remote process runs in the same account from which you execute PsExec, but because the remote process is impersonating it will not have access to network resources on the remote system. When you specify a username the remote process executes in the account specified, and will have access to any network resources the account has access to. Note that the password is transmitted in clear text to the remote system.ExamplesThis article I wrote describes how PsExec works and gives tips on how to use it:http://www.winnetmag.com/Windows/Issues/Is.../714/Index.htmlThe following command launches an interactive command prompt on \\marklap: psexec \\marklap cmdThis command executes IpConfig on the remote system with the /all switch, and displays the resulting output locally: psexec \\marklap ipconfig /allThis command copies the program test.exe to the remote system and executes it interactively: psexec \\marklap -c test.exeSpecify the full path to a program that is already installed on a remote system if its not on the system's path: psexec \\marklap c:\bin\test.exeRun Regedit interactively in the System account to view the contents of the SAM and SECURITY keys:: psexec -i -d regedit.exePsToolsPsExec is part of a growing kit of Sysinternals command-line tools that aid in the adminstration of local and remote Windows NT/2K systems named PsTools.Andre<{POST_SNAPBACK}>this is something personal for documentation to operate with remote pc's which tool is better in PsExec.exe and BeyondExec.exe from www.sysinternals.com and www.beyondlogic.comthanx for help Link to comment Share on other sites More sharing options...
seandisanti Posted August 19, 2005 Share Posted August 19, 2005 this is something personal for documentation to operate with remote pc's which tool is better in PsExec.exe and BeyondExec.exe from www.sysinternals.com and www.beyondlogic.comthanx for help<{POST_SNAPBACK}>better is very subjective. i'd say the better one is the one you prefer... look at file sizes, ease of use, and support if you're looking for criteria upon which to judge them... personally i don't use either, but i've used other stuff from sysinternals and i liked the stuff i DID use... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now