shahino007 Posted October 30, 2013 Posted October 30, 2013 Hey, I've looked already in all previous posts in this matter and tried all offers...but nothing: I'm tring to copy exe file from local computer to remote computer using psexec command: Run('psexec remotecomp xcopy "C:file.exe" "C:"') but I keep getting the message that file wasn't found. During my later tries I created the exe file in the remote computer and activated again the RUN command from the local computer (just to test what happens). Then I realized that all this time the xcopy searched the source file in the remote computer and not in the local one (got error message that says that the file cannot be copied on itself). When I changed the directories of source and destination to be different, the xcopy was OK: Run('psexec remotecomp xcopy "C:file.exe" "C:temp"'). Again - This time it was xopy from one directory in the remote to another in the same remote. How do I tell the xcopy to take the file from the local computer and copy it to the remote...?
orbs Posted October 30, 2013 Posted October 30, 2013 (edited) before you go any further - you do know that you can copy files without PsExec, right? edit: and welcome to the AutoIt forum Edited October 30, 2013 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
shahino007 Posted October 30, 2013 Author Posted October 30, 2013 Thanks, I know that in order to send commands to remote computer I need the psexec. Can you enlighten me please...
orbs Posted October 30, 2013 Posted October 30, 2013 PsExec is not used to send command to remote computer. PsExec is used to make the remote computer execute commands. this is not the same. file copy command can be executed on any machine. if you just need to copy the file, then just copy it: xcopy source_hostsource_sharesubfolderfile.ext target_hosttarget_sharesubfolder if you specify the paths correctly, and you have sufficient permissions, this command will work no matter which host is executing it. you need PsExec for commands that you can not execute on any host, and must be executed by the host of interest. for example, if you are on host A, and you need host B to ping host C, you must use PsExec on host A to instruct host B to ping host C. but if you are only manipulating the file system or registry of host B, then you can do that directly from host A. i'm not saying PsExec is useless, you can do the copy by PsExec, but it's like scratching your left ear with your right hand shoved under your knee. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
Solution shahino007 Posted October 30, 2013 Author Solution Posted October 30, 2013 Now it works OK Like the words of the great Homer Simpson: "Case Closed" Thankes
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