Getting error while using this script file name, directory name or volume label syntax is incorrect

Advertisement

maheshbabup777@gmail.com
Joined:
Posts:
4

Getting error while using this script file name, directory name or volume label syntax is incorrect

@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
/command ^
"open sftp://root:citi%%40123@10.11.97.21/ -hostkey=""ssh-ed25519 255 sY3DP2CbSTdVkkZVmUVHjszNNDFPEJb8bhlmEZElvc=""" ^
"synchronize local|remote|both  d:\syncfiles\syncfiles  /opt/syncfiles"
"exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
38,189
Location:
Prague, Czechia

Re: getting error while using this script file name, directory name or volume label syntax is incorrect

The C:\writable\path\to\log\WinSCP.log is a place holder, you need to replace it with some valid path.

The local|remote|both indicates that you need to select one of the tree options.

If this does not help, please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

maheshbabup777@gmail.com
Joined:
Posts:
4

My script is not getting executed, it is getting connected and starting the session and getting

@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
  /command ^
    "open sftp://root:ikea%%40123@10.11.97.171/ -hostkey=""ssh-ed25519 256 2bK9x/+PkrDrpa6xfu+556yQUXDU7Za7T+Tm91mC4/s=""" ^
    "synchronize local C:\users\device-1\syncfiles /opt/syncfiles" ^
     "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%

Description: please find the attachment, after connection establishment to the remote server command is not executing and it is getting exit

0ce6d2d4-2dc2-4962-8689-60af2f6389ba.jpg

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: My script is not getting executed, it is getting connected and starting the session and getting

Fix the logging and attach the log please.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
38,189
Location:
Prague, Czechia

Re: how to fix the logging can you please suggest me

Once again:
The C:\writable\path\to\log\WinSCP.log is a place holder, you need to replace it with some valid path.

Reply with quote

Advertisement

You can post new topics in this forum