Unsolved
This post is more than 5 years old
15 Posts
0
1122
December 8th, 2011 09:00
ITOI passing sm_ parameters to client tool
Trying to run a client tool and pass parameters, beginnning with just the server (host) name. Created client tool in CONSOLE\smarts\local\actions\client:
set arg0=%SM_OBJ_InstanceDisplayName%
"c:\program files\sightline\expert advisor vision\eav.exe" "z:\live\%arg0%.vtf"
"z:\environments\Windows.ven"
Right-clickon the notification, select the tool, the client program opens up, but arg0 has no value.
Trace output shows %SM_OBJ_InstanceDisplayName% has the correct value (the host
name in the notification).
What is the trick to pass these parameters?
Console is 8.1.2.1. SAM is 8.1.0.6
Thanks, Eric
No Events found!
ejpren
15 Posts
0
December 8th, 2011 12:00
More information on this -
I run:
set arg0=%SM_OBJ_InstanceDisplayName%
but the only thing that is echoed is
set arg0=
That appears to be because the SM_ objects have no value.
Hemulll
2 Intern
•
138 Posts
0
December 8th, 2011 23:00
Hi Eric, firstable u should to run next code in your client tool.
See examples in smarts/actions/client
rem If all command line arguments processed, go to processing code
if (%1) == () goto :end
rem Copy current command line argument #1 into a variable.
rem Variable will initially have the value: "name=value"
set temp=%1
rem Remove " at start of var value. Result: name=value"
set temp=!temp:"=!
rem (1) Insert " after first = in var value. Result: name="value"
rem (2) Split var value into name and "value", using = as delimiter
rem (3) Execute the resultant string as a command: set name="value"
FOR /F "delims== tokens=1,2" %%i in ("%temp%") do set %%i=%%j
ejpren
15 Posts
0
December 9th, 2011 04:00
Issue resolved by starting client with "com.smarts.clientTool.setEnv=true".