Using IPCONFIG in a CTB

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Using IPCONFIG in a CTB

Post 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!

tomuser
Posts: 135
Joined: 04 Dec 2009 18:52

Re: Using IPCONFIG in a CTB

Post by tomuser »

Like this?:
"IP Config" run "cmd" "/k ipconfig /all"

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Using IPCONFIG in a CTB

Post 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.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Using IPCONFIG in a CTB

Post 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.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Using IPCONFIG in a CTB

Post 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.

highend
Posts: 14954
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Using IPCONFIG in a CTB

Post 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.
One of my scripts helped you out? Please donate via Paypal

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Using IPCONFIG in a CTB

Post by TheQwerty »

For more information run "!cmd /?" from the adddress bar.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Using IPCONFIG in a CTB

Post 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!

Post Reply