I don't know which example you are talking about but I will show you some sample code that I have. I hope it helps. This code is all located in a .bat file.
In this example, a variable %folder% is made with the name of today's date in the format of 2/28/2012. I then ask the user for their username and it gets saved in the variable %username%, same with %password%. I then used the %folder% variable to make a directory with a folder named %folder%.
Now we dive into actual 'WinSCP Code'.
I then located the path towards my WinSCP.exe and then called console. After console was called, I connected to my WinSCP server using the 'open' command and the %Username% and %Password% variables.
@ECHO OFF
cls
set folder=%date:~4,2%-%date:~7,2%-%date:~10,4%
SET /P username="Enter Username: "
IF "%username%"=="" GOTO Error
SET /P password="Enter Password: "
rem -- Clear Screen to hide password
cls
IF "%password%"=="" GOTO Error
md C:\Logs\%folder%\int-rpt01\
"C:\""Program Files""\WinSCP\WinSCP.exe" /console /command "option batch abort"
"option confirm off" "open sftp://%username%:%password%@server.server.net:22"
"get /opt/ibm/cognos/c10_64/logs/cogserver.* C:\CogServerLogs\%folder%\int-rpt01\" "exit"
I hope this helps. Any more information on which example you are using and or how you are using it would be appreciated.