OPen an DOS WIndow

N

nathandaviesuk

I would like to create a button in a form in a spreadsheet then use some
vba code that will open a the command prompt window then automatically
enter "ipconfig" in the command prompt window to display my IP
address.

Many thanks
 
G

Gary''s Student

Three steps:

1. Create a .bat file with
ipconfig /all
pause

2. Create a macro:
Sub Macro1()
x = Shell("cmd.exe /c C:\ip.bat", 1)
End Sub

3. Make a button and associate the macro with it.
 
Top