Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Problem mit netsh und ShellExecute (https://www.delphipraxis.net/75296-problem-mit-netsh-und-shellexecute.html)

EDatabaseError 17. Aug 2006 10:41


Problem mit netsh und ShellExecute
 
Delphi-Quellcode:
 ShellExecute(Handle,'open', PChar('netsh interface ip set address "LAN-Verbindung 2" static 192.168.15.1 255.255.255.0 192.168.15.150 0'), nil, nil, SW_HIDE);
Wenn ich das ausführe bleibt die alte IP Adresse. Wenn ich aber das netsh Kommando in der Konsole ausführe wird sie geändert. Was mache ich falsch???

Mfg
Tobi

Klaus01 17. Aug 2006 10:49

Re: Problem mit netsh und ShellExecute
 
Hier ist eine Lösung zu finden: http://forum.dsdt.info/viewtopic.php...02635c4759b05e

Grüße
Klaus

ManuMF 17. Aug 2006 10:50

Re: Problem mit netsh und ShellExecute
 
Ich würde es so machen:

Delphi-Quellcode:
ShellExecute(Application.Handle, nil, 'netsh', 'interface ip set address "LAN-Verbindung 2" static 192.168.15.1 255.255.255.0 192.168.15.150 0', nil, SW_HIDE);
[edit]Sehe gerade, der Code hinter dem Link ist so wie meiner (bis auf ohne Handle)[/edit]

EDatabaseError 17. Aug 2006 11:29

Re: Problem mit netsh und ShellExecute
 
Zitat:

Zitat von ManuMF
Ich würde es so machen:

Delphi-Quellcode:
ShellExecute(Application.Handle, nil, 'netsh', 'interface ip set address "LAN-Verbindung 2" static 192.168.15.1 255.255.255.0 192.168.15.150 0', nil, SW_HIDE);
[edit]Sehe gerade, der Code hinter dem Link ist so wie meiner (bis auf ohne Handle)[/edit]

super funktioniert :thumb:


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz