Is it possible to use Windows Environment Variables in a putty logfile filename?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















Is it possible to include a Windows environment variable in a putty logfile filename? I tried using "putty - %USERNAME%.log" as my logfile, but the output file literally contains "%USERNAME%" instead of the variable contents. This suggests that it's either not possible, or putty may have an alternate escape character for environment variables. I'm hoping it's the latter...










share|improve this question























  • You mean in PuTTY GUI configuration? + What are you trying to achieve?

    – Martin Prikryl
    Jan 12 '18 at 16:35











  • Yes, as configured in the GUI configuration. I’d like to include the current username in the log file name.

    – Sam Johnson
    Jan 13 '18 at 0:41











  • We know that. But why do you need to use variable for that? What's the point? Explain us.

    – Martin Prikryl
    Jan 13 '18 at 9:02


















0















Is it possible to include a Windows environment variable in a putty logfile filename? I tried using "putty - %USERNAME%.log" as my logfile, but the output file literally contains "%USERNAME%" instead of the variable contents. This suggests that it's either not possible, or putty may have an alternate escape character for environment variables. I'm hoping it's the latter...










share|improve this question























  • You mean in PuTTY GUI configuration? + What are you trying to achieve?

    – Martin Prikryl
    Jan 12 '18 at 16:35











  • Yes, as configured in the GUI configuration. I’d like to include the current username in the log file name.

    – Sam Johnson
    Jan 13 '18 at 0:41











  • We know that. But why do you need to use variable for that? What's the point? Explain us.

    – Martin Prikryl
    Jan 13 '18 at 9:02














0












0








0


1






Is it possible to include a Windows environment variable in a putty logfile filename? I tried using "putty - %USERNAME%.log" as my logfile, but the output file literally contains "%USERNAME%" instead of the variable contents. This suggests that it's either not possible, or putty may have an alternate escape character for environment variables. I'm hoping it's the latter...










share|improve this question














Is it possible to include a Windows environment variable in a putty logfile filename? I tried using "putty - %USERNAME%.log" as my logfile, but the output file literally contains "%USERNAME%" instead of the variable contents. This suggests that it's either not possible, or putty may have an alternate escape character for environment variables. I'm hoping it's the latter...







putty






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 12 '18 at 16:18









Sam JohnsonSam Johnson

181128




181128













  • You mean in PuTTY GUI configuration? + What are you trying to achieve?

    – Martin Prikryl
    Jan 12 '18 at 16:35











  • Yes, as configured in the GUI configuration. I’d like to include the current username in the log file name.

    – Sam Johnson
    Jan 13 '18 at 0:41











  • We know that. But why do you need to use variable for that? What's the point? Explain us.

    – Martin Prikryl
    Jan 13 '18 at 9:02



















  • You mean in PuTTY GUI configuration? + What are you trying to achieve?

    – Martin Prikryl
    Jan 12 '18 at 16:35











  • Yes, as configured in the GUI configuration. I’d like to include the current username in the log file name.

    – Sam Johnson
    Jan 13 '18 at 0:41











  • We know that. But why do you need to use variable for that? What's the point? Explain us.

    – Martin Prikryl
    Jan 13 '18 at 9:02

















You mean in PuTTY GUI configuration? + What are you trying to achieve?

– Martin Prikryl
Jan 12 '18 at 16:35





You mean in PuTTY GUI configuration? + What are you trying to achieve?

– Martin Prikryl
Jan 12 '18 at 16:35













Yes, as configured in the GUI configuration. I’d like to include the current username in the log file name.

– Sam Johnson
Jan 13 '18 at 0:41





Yes, as configured in the GUI configuration. I’d like to include the current username in the log file name.

– Sam Johnson
Jan 13 '18 at 0:41













We know that. But why do you need to use variable for that? What's the point? Explain us.

– Martin Prikryl
Jan 13 '18 at 9:02





We know that. But why do you need to use variable for that? What's the point? Explain us.

– Martin Prikryl
Jan 13 '18 at 9:02










1 Answer
1






active

oldest

votes


















2














It rarely happens, but sometimes a Windows profile will "shift", moving from yourusername to yourusername.000. Since I administer a thousand systems in a cloud center, I now have about a 1000 systems in PuTTY pointing to the old profile location for logging. Using %USERPROFILE% environment variable would make the transition seamless. As it is, the only solution I can see now is to export the PuTTY registry key, and search and replace the user name string with the new one. Not difficult to do, but using the Windows environment value would be helpful.






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1284938%2fis-it-possible-to-use-windows-environment-variables-in-a-putty-logfile-filename%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    It rarely happens, but sometimes a Windows profile will "shift", moving from yourusername to yourusername.000. Since I administer a thousand systems in a cloud center, I now have about a 1000 systems in PuTTY pointing to the old profile location for logging. Using %USERPROFILE% environment variable would make the transition seamless. As it is, the only solution I can see now is to export the PuTTY registry key, and search and replace the user name string with the new one. Not difficult to do, but using the Windows environment value would be helpful.






    share|improve this answer




























      2














      It rarely happens, but sometimes a Windows profile will "shift", moving from yourusername to yourusername.000. Since I administer a thousand systems in a cloud center, I now have about a 1000 systems in PuTTY pointing to the old profile location for logging. Using %USERPROFILE% environment variable would make the transition seamless. As it is, the only solution I can see now is to export the PuTTY registry key, and search and replace the user name string with the new one. Not difficult to do, but using the Windows environment value would be helpful.






      share|improve this answer


























        2












        2








        2







        It rarely happens, but sometimes a Windows profile will "shift", moving from yourusername to yourusername.000. Since I administer a thousand systems in a cloud center, I now have about a 1000 systems in PuTTY pointing to the old profile location for logging. Using %USERPROFILE% environment variable would make the transition seamless. As it is, the only solution I can see now is to export the PuTTY registry key, and search and replace the user name string with the new one. Not difficult to do, but using the Windows environment value would be helpful.






        share|improve this answer













        It rarely happens, but sometimes a Windows profile will "shift", moving from yourusername to yourusername.000. Since I administer a thousand systems in a cloud center, I now have about a 1000 systems in PuTTY pointing to the old profile location for logging. Using %USERPROFILE% environment variable would make the transition seamless. As it is, the only solution I can see now is to export the PuTTY registry key, and search and replace the user name string with the new one. Not difficult to do, but using the Windows environment value would be helpful.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 5 at 18:41









        EricNEricN

        213




        213






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1284938%2fis-it-possible-to-use-windows-environment-variables-in-a-putty-logfile-filename%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix