Run cmd commands using tcl without opening terminal
Answers
-
Hi,
did you try: exec cmd /C dir
?
0 -
Altair Forum User said:
Hi,
did you try: exec cmd /C dir
?
@tinh : Yes, i did try it. Although it seems to work for some commands, it does not work for all. For example, if the command is 'dir' it does return the output without opening a terminal and stores it into result when I use,set result [exec cmd /c dir]
However, when I use
set result [exec cmd /c ipconfig]
it does not return the output to my variable and instead opens up a new cmd terminal window and runs the ipconfig command in it, and closes it once the command has run, which is exactly what I want to avoid.
How could I get around this issue ?
0 -
Hi,
ipconfig is an external command (an .exe file) so you should do:
set result [exec ipconfig.exe]
0 -
Altair Forum User said:
Hi,
ipconfig is an external command (an .exe file) so you should do:
set result [exec ipconfig.exe]
Hi,
This worked perfectly for me. Thank you.
0