Autor Beitrag
shr00m
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 18

WIN 95, XP Home, Vista HP; Ubuntu 7.10; openSUSE 10.3
D3 Prof., D6 P, D2005 P, C++, VB6
BeitragVerfasst: Mi 09.05.07 19:10 
folgendes problem: ich starte cmd.exe mit ShellExecute, das hab ich ja hingekriegt, is ja auch nich sooo schwierig, nur wie kann ich dann dem cmd-menü Befehle erteilen die es ausführen soll? Mal für das Beispiel das mir dann das CommandMenü die net user auflistet!

Danke im voraus! :)
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mi 09.05.07 19:17 
Wenn du als Parameter /c oder /k angibst kannste dahinter Befehle angeben, die ausgeführt werden.
Einziger Unterschied ist, dass bei /k die Konsole geöffnet bleibt, während sie bei /c nach Abarbeitung geschlossen wird.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
shr00m Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 18

WIN 95, XP Home, Vista HP; Ubuntu 7.10; openSUSE 10.3
D3 Prof., D6 P, D2005 P, C++, VB6
BeitragVerfasst: Mi 09.05.07 19:31 
oh, thx.. ich häts mir schwieriger vorgestellt ^^
shr00m Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 18

WIN 95, XP Home, Vista HP; Ubuntu 7.10; openSUSE 10.3
D3 Prof., D6 P, D2005 P, C++, VB6
BeitragVerfasst: Mi 09.05.07 20:10 
wollt nur nochmal spaßenshalber fragen...

ausblenden Delphi-Quelltext
1:
ShellExecute(Handle,nil,'C:\Windows\system32\cmd.exe',('/k net send XXX YYY'),nil,1);					


kann mans auch irgendwie realizieren, ('/k net send XXX YYY') in eine Schleife zu packen, ohne das sich das CommandMenü mehrmals öffnet. Also mehrere Befehle in ein Fenster?

Ich will nix unanständiges damit anstellen versprochen ^^

Moderiert von user profile iconmatze: Delphi-Tags hinzugefügt
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Mi 09.05.07 20:23 
Nachrichten über den Nachrichtendienst versenden läßt sich auch einfacher, ohne Net Send machen. Dafür gibt es nämlich eine eigene Funktion in netapi32.dll, NetMessageBufferSend. Vielleicht steht sogar was hier im Forum dazu, ansonsten schau einfach bei MSDN nach.
EDIT: Hier hat user profile iconLuckie eine wunderschöne NetSend-Prozedur geschrieben. Die brauchst du nur noch abtippen, oder, wenn es ganz schnell gehen muss, kannste du auch Copy&Paste verwenden.