Page 1 of 1

Using IPCONFIG in a CTB

Posted: 04 Aug 2011 15:28
by aurumdigitus
Have been using |ipconfig /all successfully in the Address Bar. However, when attempting to convert it into a script for a CTB no amount of syntax tinkering has produced a viable result.

It may well be something obvious and/or minor but it has escaped me. :(

Your help - as always - will be appreciated!

Re: Using IPCONFIG in a CTB

Posted: 04 Aug 2011 15:40
by tomuser
Like this?:
"IP Config" run "cmd" "/k ipconfig /all"

Re: Using IPCONFIG in a CTB

Posted: 04 Aug 2011 15:43
by TheQwerty
As tomuser demonstrated, you use to have to use the Run command as such:

Code: Select all

run('cmd "/K ipconfig /all"');
But when Don introduced the ability to run commands from the address bar it became easier to use:

Code: Select all

goto('!ipconfig /all');
The first approach still has a few advantages if you're doing more with the script or need to specify the working directory.

Re: Using IPCONFIG in a CTB

Posted: 04 Aug 2011 15:57
by aurumdigitus
Thank you both for responding with such celerity. You folks who monitor the Forum and graciously give your aid are one of XY's greatest assets!

The the record the "tinkering" had gotten as far as CMD but the inclusion of RUN was the needed element, alas and alack.

Re: Using IPCONFIG in a CTB

Posted: 04 Aug 2011 17:36
by aurumdigitus
The CTB is up and running so the goal has been realized.

But to convert this episode into a genuine learning experience need to about about the syntax of "/K". Cannot find it in either CHM or PDF help. By experiment have noted script fails without it.

Re: Using IPCONFIG in a CTB

Posted: 04 Aug 2011 17:59
by highend
They don't fail if you leave that parameter out but the dos box is closed automatically after executing the dos command. /k keeps it open instead.

Re: Using IPCONFIG in a CTB

Posted: 04 Aug 2011 18:03
by TheQwerty
For more information run "!cmd /?" from the adddress bar.

Re: Using IPCONFIG in a CTB

Posted: 04 Aug 2011 19:50
by aurumdigitus
TheQwerty wrote:For more information run "!cmd /?" from the adddress bar.
Ah yes! Can remember when MS-DOS came on two 3 inch diskettes. But the intricacies of its operation have long since "gone with the wind".

Thanks for jogging the memory bank!