Jump to content

Psexec and xcopy


Go to solution Solved by shahino007,

Recommended Posts

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...?

Link to comment
Share on other sites

before you go any further - you do know that you can copy files without PsExec, right?

edit: and welcome to the AutoIt forum  :)

Edited 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

 

Link to comment
Share on other sites

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...