• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended
QTP
Microsoft Windows XP

QTP needs to be restarted for system environment variable changes to take effect

 

I am changing MQSERVER variable to a value that I need runtime using . This is required to access websphere MQ

 

    

 Set objWSH = CreateObject("WScript.Shell")
 Set objSystemVariables = objWSH.Environment("SYSTEM") 
 objSystemVariables(MQVariableName) = MQVariableValue

 But when I try to read a valid queue manager, it gives me error 2058 ( MQRC_Q_MGR_NAME_ERROR)

 

When I restart QTP, that environment variable reflects and I can access MQ manager successfully without changing any code. What is the best way to not have to restart QTP in these circumstances.

Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.