isaiasodr Posted December 20, 2023 Report Share Posted December 20, 2023 Boa Tarde, estou precisando criar uma função que faça esse comando do Windows: wmic process where processid="PID" get parentprocessid para poder capturar o id do processo pai e a função retornar o nome do processo pai, alguém pode me ajudar? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 20, 2023 Report Share Posted December 20, 2023 Pode ser via .BAT? e você chama via WINEXEC()? https://superuser.com/questions/1776533/wmic-processid-does-not-get-parsed-within-the-same-command-instance abs. Regards, saludos. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 20, 2023 Report Share Posted December 20, 2023 Veja se ajuda: https://forums.fivetechsupport.com/viewtopic.php?f=3&t=41277&p=247238&hilit=+PID+&sid=dc9c4257f56752edf4b5d0fd711f8921#p247238 Regards, saludos. Quote Link to comment Share on other sites More sharing options...
Jmsilva Posted December 20, 2023 Report Share Posted December 20, 2023 #include "fivewin.ch" function Main() ? GetWMIC() Return nil Function GetWMIC() Local cResp,oDatos Local oLoc:= CreateObject( "wbemScripting.SwbemLocator" ) Local oWMI:= oLoc:ConnectServer() Local oProc := oWMI:ExecQuery("Select parentprocessid from Win32_Process where processid=820") FOR EACH oDatos IN oProc cResp := cValtoChar(oDatos:parentprocessid) NEXT Return cResp Quote Link to comment Share on other sites More sharing options...
isaiasodr Posted January 5 Author Report Share Posted January 5 JmSilva muito obrigado, com a sua dica aí consegui resolver o meu problema. Jmsilva 1 Quote Link to comment Share on other sites More sharing options...
isaiasodr Posted January 5 Author Report Share Posted January 5 @kapiaba muito obrigado pela disposição em ajudar, cada dica é valiosa para mim, que sou apenas um iniciante na profissão de programador e na linguagem em questão hehehe. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.