Release Automation

Expand all | Collapse all

setx not recoginzed?

Michael Gebhardt

Michael GebhardtJun 22, 2017 01:22 AM

  • 1.  setx not recoginzed?

    Posted Jun 21, 2017 08:05 AM

    Hey,

     

    I have a command line action where I'm trying to do this:

    setx PATH "%PATH%;C:\Perl\site\bin;C:\Perl\bin" /M

     

    but I'm getting the error: 'setx' is not recognized as an internal or external command, operable program or batch file.

     

    when I'm running the command on the server directly it is working fine.

     

     

    Anyone an idea what's the problem?

     

    I'm very confused that the action doesn't recognize the command but I can execute it fine on the server directly

     

    thanks,

    Michael



  • 2.  Re: setx not recoginzed?

    Posted Jun 21, 2017 10:11 AM

    Hi Michael, 

     

    When you run this command directly on the server, are you running it as the same user used to run the action through the RA agent?

     

    Thanks,

    Adam



  • 3.  Re: setx not recoginzed?

    Posted Jun 22, 2017 01:22 AM

    Hi Adam,

     

    yes, its the same user.

     

    best regards

    Michael



  • 4.  Re: setx not recoginzed?

    Broadcom Employee
    Posted Jun 21, 2017 05:27 PM

    Something's fishy -- setx works fine for me in my lab:

     

     

    I kicked off a test of that action and it ran successfully.  The only difference is I didn't use an environment variable in my test.



  • 5.  Re: setx not recoginzed?

    Posted Jun 22, 2017 01:24 AM

    I guess you used CA RA 6.4 for the test?, forgot to mention my version in the opening post

     

    I will do some testing then today, also need to try it with an environment parameter, see if this might be the problem



  • 6.  Re: setx not recoginzed?
    Best Answer

    Posted Jun 22, 2017 10:38 AM

    Hi Michael,

     

    I ran some further tests and I was able to replicate your error. For me, this error occurred when I had values entered in the action's "Environment Variables Names" and "Environment Variables Values" input fields. When I left these inputs with no value, the action ran properly.

     

    Is there any specific reason why you were using these inputs? Could you test the action without these inputs?

     

    Please let us know if that works for you.



  • 7.  Re: setx not recoginzed?

    Broadcom Employee
    Posted Jun 22, 2017 12:25 PM

    Thanks for catching that Adam!  I was about to say -- RA version usually doesn't matter as much as action pack version.  I was starting to get suspicious about the environment parameter field.

     

    Definitely interested as to the reason behind that parameter usage -- that seems to be our missing link. 



  • 8.  Re: setx not recoginzed?

    Posted Jun 23, 2017 12:36 AM

    Thanks Adam and James.

     

    to answer your question, I have these parameters filled because in previous CA RA version I wasn't able to use system environment variables in the run command line action. if I can reference now %PATH% without any issues, I gladly remove those parameters as it also means I don't need to read out the path before adding stuff to it.



  • 9.  Re: setx not recoginzed?

    Posted Jun 29, 2017 06:14 AM

    Hi lewad02 abd JamesPanetti , any input on the question regarding the environment variable usage in the run command line action that I mentioned?

     

    thanks,

    Michael



  • 10.  Re: setx not recoginzed?

    Broadcom Employee
    Posted Jun 29, 2017 11:24 AM

    Not yet -- I've been pinned down this week putting out some fires.  I will get clarification on that for you though. 



  • 11.  Re: setx not recoginzed?

    Posted Jun 29, 2017 11:27 AM

    oh, hope you were able to extinguish them all



  • 12.  Re: setx not recoginzed?

    Broadcom Employee
    Posted Jul 03, 2017 12:37 AM

    Hi,

     

    I think your "Environment Variable Values" doesn't have path for setx.exe. 

    When you set "PATH" to "Environment Variable Names", this action will use your <system_path_variable> instead of  "PATH" in System Environment Variable.  

    I expect you can run the action if <system_path_variable> parameter has the path to setx.exe like "C:\Windows\System32".

     

    Thanks

    Yas



  • 13.  Re: setx not recoginzed?

    Posted Jul 03, 2017 01:07 AM

    Hi Yas,

     

    this should not be the case, because the PATH parameter I'm setting in this action is exactly the same as the environment system variable as I did read it out beforehand.

     

    As I said before, I'm doing this because in previous version of CA-RA you where not able to use system variables without setting them in the action itself.

     

    best regards

    Michael



  • 14.  Re: setx not recoginzed?

    Broadcom Employee
    Posted Jul 03, 2017 04:19 AM

    HI,

     

    I know your original question can be solved with Adam's advice.

    My comment is just additional info.

     

    Here is my verification.

    In this case, your problem can be reproduced.

     

    Add "C:\Windows\System32" to find setx.exe to Environment Variable Values, and then this action can be succeeded.

     

     

    So, I recommended to check the content of your parameter. The error is returned by not RA but Windows.

    I checked the behavior on RA 5.5.2 and 6.2.

     

    Thanks

    Yas