사용자 입력 경로 psftp 스크립트 배치 파일 (User input path psftp script batch file)


문제 설명

사용자 입력 경로 psftp 스크립트 배치 파일 (User input path psftp script batch file)

I am trying to implement a scenerio like the user should give a path and the path should be binded to another .

bat file and that path should be the destination where am going to put my file from local. 

My code looks like this: 

  • Getfile.bat:

    set /P INPUT=Type input: 
    psftp <user>@<IP> ‑b D:\FileTransfer.bat ‑pw <PW>
    
  • Filetransfer.bat:

    cd %INPUT% 
    lcd d:\ 
    put log.sh 
    
  

Error :Access denied Remote working directory is /home/irisuser Directory /home/irisuser/%INPUT%: no such file or directory


참조 솔루션

방법 1:

Your variable %INPUT% is not passed to Filetransfer.bat. If you want psftp to cd into a user‑defined directory, you have to create Filetransfer.bat on the fly:

set /P INPUT=Type input: 

>D:\Filetransfer.bat echo.cd %INPUT%
>>D:\Filetransfer.bat echo.lcd d:\
>>D:\Filetransfer.bat echo.put log.sh

psftp <user>@<IP> ‑b D:\FileTransfer.bat ‑pw <PW>

(by sureshAnsgar Wiechers)

참조 문서

  1. User input path psftp script batch file (CC BY‑SA 3.0/4.0)

#FTP #batch-file #CMD #command-line






관련 질문

사용자 입력 경로 psftp 스크립트 배치 파일 (User input path psftp script batch file)

Android의 비동기 클래스에서 FTP 다운로드에 진행률 표시줄을 표시하는 방법은 무엇입니까? (How to show the progress bar in FTP download in async class in Android?)

Excel VBA - WinSCP 명령줄에 공백이 있는 변수 경로 전달 (Excel VBA - Passing a variable path with spaces to WinSCP command-line)

PHP에서 ftp를 사용하여 서버에 파일 업로드 (upload the file into the server using ftp in php)

VSFTP 연결 오류 (VSFTP Error Connecting)

ftp를 통해 게시할 때 액세스가 거부되었지만 로컬 IIS(.NET 응용 프로그램)에 게시할 때는 제대로 작동합니다. (Access denied on publish via ftp but works fine on publish to local IIS (.NET Application))

FTP 바이너리 전송 후의 Charset (Charset after FTP binary transfer)

FTP4J를 사용하여 FTP에 연결할 수 없음 (Unable to connect to FTP using FTP4J)

twisted.protocols.ftp.FTP에서 REST를 구현하시겠습니까? (Implementing REST in twisted.protocols.ftp.FTP?)

루트 액세스 없이(설치용) 프로젝트에서 libfuse를 사용하시겠습니까? FTP 마운트 및 inotify/kqueue/FSEvents (Use libfuse in a project, without root access (for installation)? FTP mounts & inotify/kqueue/FSEvents)

사용자 이름: root, 호스트: <host_ip>로 로그인할 수 없습니다. (Could not login with username: root, host: <host_ip>)

FTP Python 550 매개변수 잘못된 파일 이름 오류 (FTP Python 550 Parameter Incorrect Filename Error)







코멘트