Set Environment Variables

BatchPatch Forums Home Forums BatchPatch Support Forum Set Environment Variables

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9067
    hugomarinho
    Participant

    Hi Doug,

    How can I set a environment Variables on multiples servers with batchPatch?

    SET CLIENT=FQDN

    Thanks

    #10805
    hugomarinho
    Participant

    If possible on lowercase 🙂

    #10806
    doug
    Moderator

    Hugo – I’m not sure that this is really a question about BatchPatch so much as it’s a question about environment variables. I’m not an expert on environment variables.

    BatchPatch can execute remote commands, as you know. So it’s just a question of finding the correct command to execute.

    I did a quick google search on environment variables, and from what I found the “SET” command only sets current session variables. If you want to set a system variable you have to use “SETX” instead. It also says that updates made with SETX will only be visible to the next logon session, which essentially means that if you use BatchPatch to add/update a variable on ComputerX, then on ComputerX you will not see this change until/unless you logoff and log back on to ComputerX to verify it.

    That said, in BatchPatch I simply highlighted my target host(s) and created a remote command with the following syntax:

    SETX client myfqdn

    I then executed the command in BatchPatch and it reported “Exit Code: 0 (SUCCESS).” So, I logged on to the remote system to verify it was there. On the remote system I opened a cmd prompt and typed “SET” and I could see the value that I set previously was visible.

    -Doug

    #10807
    hugomarinho
    Participant

    Thanks but I lauch this command on which menu on BatchPatch? remote command 3?

    #10808
    doug
    Moderator

    Remote Command 3 will work, yes.

    -Doug

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.