Can't use %APPDATA% in "Custom INI file:", but I can in "Random seed file:"

Advertisement

Sopor
Sopor avatar
Joined:
Posts:
63
Location:
Sweden

Can't use %APPDATA% in "Custom INI file:", but I can in "Random seed file:"

I want to have the path to my WinSCP.ini like this %APPDATA%\WinSCP\WinSCP.ini, but if I try that I get an error message (see attached file).

I can use %APPDATA%\WinSCP\winscp.rnd for the seed file without any error message.

I don't have any winscp.rnd file in %APPDATA%\WinSCP\, though.

Maybe that path is invalid for the seed file too? The only difference is that it won't show an error message?

After changing the path to C:\Users\<username>\AppData\Roaming\WinSCP\winscp.rnd I now have a winscp.rnd file too.

winscp-appdata.png

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Can't use %APPDATA% in "Custom INI file:", but i can in "Random seed file:"

You can use /ini=%APPDATA%\WinSCP\WinSCP.ini command-line switch, if you want to use environment variables. You can create a desktop shortcut for that.

Reply with quote

Sopor
Sopor avatar
Joined:
Posts:
63
Location:
Sweden

I don't know how it should work, but if I get an error message when I use %APPDATA% in the INI path. Shouldn't it show the same error message in the seed file path when I use %APPDATA%?

Will WinSCP work without a seed file? I don't really know what it do, but I didn't have one in my folder.

BTW, why isn't variables supported like most other Windows program?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

You mean you get an error even when you use /ini=%APPDATA%\WinSCP\WinSCP.ini?

Currently all errors when writing the random seed file are silently ignored. WinSCP works without random seed file, but it degrades security.

What "most other Windows program" have similar configuration that allows using environment variables?

Reply with quote

Sopor
Sopor avatar
Joined:
Posts:
63
Location:
Sweden

No, I haven't tried /ini= yet.

If more than one account use WinSCP, how will that work if it won't support variable names?

If I open the dropdown menu for external applications I will find this line:
%ProgramFiles%\PuTTY\putty.exe -t -m "%TEMP%\putty.txt" !`cmd.exe /c echo cd '!/' ; /bin/bash -login > "%TEMP%\putty.txt"`
So, it looks like it will work, but not everywhere 😊

Reply with quote

Advertisement

martin
Site Admin
martin avatar

What will work? The /ini=%APPDATA%\WinSCP\WinSCP.ini? The %APPDATA% in shortcut target is resolved by Windows shell before executing WinSCP.

And yes, WinSCP supports environment variables in PuTTY command-line. That's imo quite irrelevant here.

Reply with quote

Sopor
Sopor avatar
Joined:
Posts:
63
Location:
Sweden

So, you mean that every user that run WinSCP have to add /ini=%APPDATA%\WinSCP\WinSCP.ini as a command line switch to the shortcut?

That sounds a bit too complex for the regular user. That should be supported by default.

That is why i found it a bit weird that it won't supports it in the Configuration storage paths.

Reply with quote

johnwick6
Joined:
Posts:
1

GUEST POST

Get help and report bugs here. I'll try to answer your questions as soon as possible. Maybe other users answer you faster. Before posting, please learn How to ask for support or report bug.



MALIK66

Reply with quote E-mail

Advertisement

Sopor
Sopor avatar

I have tried to use Automatic INI file but it will only mess it up for me.

Strange that it use %APPDATA% in Automatic INI file, but I can't manually use it in Custom INI file. 😥

Reply with quote

Advertisement

You can post new topics in this forum