It's all about the answers!

Ask a question

The RTC SCM line command doesn't work inside a web application. Am I missing any configuration?


Bruno Jellinek (262) | asked Aug 22 '16, 8:28 a.m.
edited Aug 22 '16, 8:31 a.m. by Ralph Schoon (63.1k33646)
The RTC SCM line command doesn't work inside a aspx web application but it works in this Server machine when I call the same line command from a  Windows (DOS) prompt .
I'm using a Windows Server 2012 R2 with IIS 8.5
This is the c# call:

ProcessStartInfo processStartInf = new ProcessStartInfo("cmd.exe");
            processStartInf.RedirectStandardInput = true;
            processStartInf.RedirectStandardOutput = true;
            processStartInf.UseShellExecute = false;
            processStartInf.StandardOutputEncoding = Encoding.GetEncoding(860);
            Process processs = Process.Start(processStartInf);

           processs.StandardInput.WriteLine("PATH C:\\Program Files\\IBM\\RTCClient\\jazz\\scmtools\\eclipse;%path%");

           processs.StandardInput.WriteLine("CD C:\\Program Files\\IBM\\RTC Client\\jazz\\scmtools\\eclipse");
           processs.StandardInput.WriteLine("scm list baselines -w 1000 -C 1061 -r https://rtcRepository/ -u username -P password -m 1");
          
           string pp = processs.StandardOutput.ReadLine(); 
           
           processs.StandardInput.Close(); // line added to stop process from hanging on ReadToEnd()
             
           string outCmd = (processs.StandardOutput.ReadToEnd());
         

Accepted answer


permanent link
Bruno Jellinek (262) | answered Aug 25 '16, 2:45 p.m.
 Thank  you.
I found the answer:
- the Web Appication that uses scm command line needs in the IIS Application Pool an Identity that has to be configured with a RTC user as Custom Account. 
Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (63.1k33646) | answered Aug 23 '16, 4:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Aug 23 '16, 4:35 a.m.
1. The question lacks any information that would allow to answer any question, there is no error log or even a version number
2. I have called processes but I am not aware of the specific call technique above would work or maybe block on any input or output pipe
3. I don't know what data you can access from the web application, these days web applications do not necessarily allow to execute from arbitrary folders as this would help malware
4. It is in general not a good idea to install into Program Files as this is a folder structure that is specially protected e.g. you will fail to create folders in the application if it is not explicitly run with runAs Admin

 processs.StandardInput.WriteLine("PATH C:\\Program Files\\IBM\\RTCClient\\jazz\\scmtools\\eclipse;%path%"); has no space, the next line has one in "CD C:\\Program Files\\IBM\\RTC Client\\jazz\\scmtools\\eclipse"  


Comments
Bruno Jellinek commented Aug 23 '16, 12:52 p.m.
1 -  I don't have any kind of event registered on the EventViewer to show you, it isn't an error 
2 - during development in another machine  while debbugin it works well as a web application at LocalHost 
3 - I access the rtc repository  through Windows (DOS) prompt in the same server it is deployed and using the same command of the application  but it doesn't  work via web without any error message
4 - I don't need to use files yet , first I only need to get response of the scm command line
It seems you are right and maybe the web applications are not necessarily allowed to execute .exe commands like scm to improve security.
Do you know any IIS or Windows or other configuration that can be done to permit this type of execution?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.