Invoke windows commands from RTC javascript
![]() Hi all, I am trying to invoke a simple windows command from javascript within RTC and was unsuccessful. This command is invoked when the buildtrackingitem entered "Declare Green" state. I tried WScript.Shell but not working so far. Please see the script snippet below for more details. Any suggestion/help would be much appreciated. dojo.provide("com.test.providers.script.ValidateStatetoDeploy");
dojo.require("com.ibm.team.workitem.api.common.Status");
dojo.require("dojo.data.ItemFileWriteStore");
(function() {
validate: function(attributeId, workItem, configuration) {
//invoke windows command here
wsh.Run("echo > C:\tmp\validateFile.txt");
return vStatus.OK_STATUS;
|
3 answers
![]()
Hi,
When you say it does not work, how do you know? What error message do you see in the log file? IMHO the object "ActiveXObject" only exists in Microsoft's JavaScript engine which is not the javaScript engine being used by RTC. Simon |
![]()
There are a few things to consider.
1. ActiveX may not work properly in browsers other than IE. 2. The script will most likely be executed twice - once on the client side (by the browser JavaScript engine), and another time on the server side (by the RTC/Eclipse JavaScript engine). 3. You may need to escape the backslash, or use forward slash instead. |