2015-07-20 21:41 GMT+02:00 Richard Mace <[email protected]>: > > Hi All, > I hope this question is going to make sense. > I am trying to obtain the MAC Address of a remote PC, using psexec > \\pcname and running the command "ipconfig /all". > If I run the psexec command from my machine via a command prompt, ipconfig > /all is successfully run on the remote machine, and I can see it's MAC > address, however, if I run it via TProcess, in Lazarus, the output I get > from TProcess is the output from psexec (successfully run and exited with > error code 0) rather than the output from ipconfig. > How can I code TProcess, so that it shows me the output from the "ipconfig > /all" command instead? >
Hello, This is not exactly what you asked for, but you could simply redirect the output with something like "ipconfig /all > ipconfig..txt" then read the contents of ipconfig.txt (or whatever name you gave to the output file). You must take care where you put the output file, though: you must have the rights to write in that folder. Of course my solution is only a quick trick, the answer to your question would be much cleaner and much more interesting. -- Frederic Da Vitoria (davitof) Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
