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

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%

martin
Joined:
Posts:
38,659
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.

maheshbabup777@gmail.com

## getting error like synchronize is not an external or internal command

i can able to login but getting an error like synchronize is not an external or internal command

martin

## Re: getting error like synchronize is not an external or internal command

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

martin

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

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