-1

I am trying to copy from one Windows 7 system to another. I want the destination directory to be C:\Windows\Temp. If I omit the destination directory, it copies the file to the remote computer's home directory for "myuser". Great, but I can't get it to copy to C:\Windows\Temp. User "myuser" has permission to write to C:\Windows\Temp. I tried different formats for the destination directory: C:\Windows\Temp\, /Windows/Temp/, etc.

Here is the command:

winscp.exe /command "option batch abort" "option confirm off"   
"open myuser:mypassword@myhost" "put myfile /Windows/Temp/"

I also tried using the cd command to set the working directory, but it still would not copy the file:

winscp.exe /command "cd C:\Windows\Temp" "option batch abort" "option confirm off"  
"open myuser:mypassword@myhost" "put myfile "

Thanks for any help.

Martin Prikryl
  • 147,050
  • 42
  • 335
  • 704
Mark Norman
  • 1
  • 1
  • 2

3 Answers3

0

Do you actually know what path syntax your server is using? Or are you guessing?

Just connect with WinSCP GUI and see the initial remote directory. This will give you an idea what the syntax is.

There are lot of options, depending on server software:

  • /cygwin/C/temp/
  • /C:/temp/
  • /C/temp/
  • C:/temp/
  • /temp/
  • and others.

That's for SFTP that mandates / path separator. With FTP, all the variants are also possible with \, though it is rare; and WinSCP does not support such servers well.

The C: drive can even be out of the FTP/SFTP server root. Particularly if your account is "chrooted".

Martin Prikryl
  • 147,050
  • 42
  • 335
  • 704
0

Just follow the steps:-

  1. Right click on file (Which you want to edit) hover on edit then click on config

  2. Click on Internal editor then click up button until become in first position

  3. Then click on OK

  4. Then open file it will open on default editor (Only one time edit)

  5. Then Change Internal editor to your desire editor from WinSCP setting

Shamim
  • 479
  • 4
  • 10
-1

Anything under your "\windows" folder is arguably a very poor choice, from a security perspective.

And that's probably the problem: security restrictions.

Try substituting a different directory.

For example:

1) open a command prompt, and type "echo %temp%"

2) You'll probably see something like "c:\Users\xxx\AppData\Local\Temp"

3) Try copying to that directory and see if you have any better luck

ALSO:

4) Be sure to check for potential firewall issues, too!

paulsm4
  • 99,714
  • 15
  • 125
  • 160