View Single Post
Old 05-27-2021, 09:15 AM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,636
Hi stevo,

I think you misunderstood the prior post.

That individual was setting the Logon script option in SecureCRT (Connection / Logon Actions) to use a path for which he had made an environment variable.

For example, let's say I create an environment variable in Windows named "stevo" and I make that path equal to C:\Temp\MyPythonScript\ and my session name is "server". Then in that directory I can have as the script I want to run as my logon script. Then in the Logon script field I would have (I've tried to use color to show how the variables resolve.)

I've just tested this again and it does indeed work.

However, what you are trying to do I don't think is possible. The environment variables *within* a script are not resolved by Windows at runtime.

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote