Forum Discussion

leandropoblet's avatar
leandropoblet
Frequent Contributor
11 years ago
Solved

Execute elevated command line tools

Hi all,



I'm experiencing some crashes in our application. The thing is I need to execute a memory dump before killing the application which is failing to close properly.





We are using this tool: ProcDump

which requires to be executed in an elevated terminal.



I also need help on how to call it in C# script since I couldn't find how to do it.



Cheers!
  • To run an elevated application from TestComplete, you need to run TestComplete as an administrator.



    You can run apps using either TestedApps, or the shell's Run method:



    Sys["OleObject"]("WScript.Shell")["Run"]("procdump notepad", 1, true);



    If the command line includes file paths with spaces, put quotes around them:



    Sys["OleObject"]("WScript.Shell")["Run"]("\"C:\My Tools\procdump.exe\" notepad", 1, true);

3 Replies

  • leandropoblet's avatar
    leandropoblet
    Frequent Contributor
    Hi Helen,



    The devs suggested the app... so I guess the have used it in the past.

    I'll offer them both options if you help me with the other one too.



    Thanks in advance,

    Leandro
  • To run an elevated application from TestComplete, you need to run TestComplete as an administrator.



    You can run apps using either TestedApps, or the shell's Run method:



    Sys["OleObject"]("WScript.Shell")["Run"]("procdump notepad", 1, true);



    If the command line includes file paths with spaces, put quotes around them:



    Sys["OleObject"]("WScript.Shell")["Run"]("\"C:\My Tools\procdump.exe\" notepad", 1, true);