Hi, here some more tips to this subject:
1) This way to get the users' temp directory may work well in all cases :
Define_Com Class(#STD_STRNG) Name(#USER_APPDATA)
Define_Com Class(#STD_STRNG) Name(#USER_PROFILE)
Define_Com Class(#STD_STRNG) Name(#USER_TMP_PATH)
* determine the user profile, user appdata and user temp path
#STD_QORD := 'Volatile Environment'
#STD_INSTR := 'USERPROFILE'
Use Builtin(get_registry_value) With_Args(HKEY_CURRENT_USER #STD_QORD #STD_INSTR) To_Get(#USER_PROFILE #RETCOD2)
#STD_INSTR := 'LOCALAPPDATA'
Use Builtin(get_registry_value) With_Args(HKEY_CURRENT_USER #STD_QORD #STD_INSTR) To_Get(#USER_APPDATA #RETCOD2)
#USER_TMP_PATH := #USER_APPDATA + '\temp\'
2) This (Powershell) script can deliver the IP address(es) :
(get-ciminstance -Query "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE DNSHostName = '$([System.Environment]::MachineName)'")[0].IPAddress[0]
or this to store the output to a file in the users temp directory :
(get-ciminstance -Query "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE DNSHostName = '$([System.Environment]::MachineName)'")[0].IPAddress[0] | Out-String -Width 256 | out-file -encoding utf8 "$env:temp\IPAddress,txt"
store this as a Powershell script , e.g. getIPaddr.ps1
and embed it in VL with :
* Get IP Address
Def_List Name(#WLIST) Fields(#STD_STRNG) Counter(#STD_COUNT) Type(*WORKING) Entrys(*MAX)
#STD_QSEL := '/f /c Powershell < getIPaddr.ps1'
Use Builtin(SYSTEM_COMMAND) With_Args(B 'CMD /Admin' #STD_QSEL) To_Get(#std_num)
#STD_QSEL := #USER_TMP_PATH + '/IPAddress.txt'
Use Builtin(TRANSFORM_FILE) With_Args(#WLIST #STD_QSEL TU B Y) To_Get(#RETCOD)
Selectlist Named(#WLIST)
#IP_ADDRESS := #STD_STRNG
Leave
Endselect
(see also this article:
https://adamtheautomator.com/powershell-get-ip-address/ )
3) You may set the current temp path location for LANSA execution yourself within LANSA
by using the TPTH= parameter , e.g. in X_LANSA,PRO to point to any path you choose!!