Topic "Username in batch script retrieval"

Author Message
Whykonen

Guest


Hello,

I'm trying to retrieve the username of a stored session, to use in the batch script.

Is there a parameter to retrieve UserName as defined in winscp.ini?

Thanks in advance!

Script:

Code:

IF EXIST "C:\Users" goto nietwinxp
IF EXIST "C:\Documents and Settings" goto winxp

:nietwinxp
echo nietwinxp
winscp.com /script=nietwinxp.txt
if errorlevel 1 goto error
goto end

:winxp
echo winxp
winscp.com /script=winxp.txt
if errorlevel 1 goto error
goto end

:error
cscript sendmail.vbs addresseddude@provider.com "subject line" "Content, username here"

:end
PAUSE
[/code]
Whykonen

Guest


Fixed the problem, i used

for /F "delims=" %%a in ('findstr /c:UserName WinSCP.ini') do set username=%%a
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License