How many time my application is run in memory (SOLVED)

User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: How many time my application is run in memory (SOLVED)

Post by MarcoBoschi »

Jimmy,
It's Fantastic!

In this way I can verify from client if there is a running application in my server

oWMI := oLocator:ConnectServer( "srvmng" , , user , password )
Many thanks
Marco Boschi
info@marcoboschi.it
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: How many time my application is run in memory (SOLVED)

Post by MarcoBoschi »

In this url
https://stackoverflow.com/questions/677867/run-application-or-process-on-a-remote-computer

it seems that I can execute in a remote server a program
Marco Boschi
info@marcoboschi.it
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: How many time my application is run in memory (SOLVED)

Post by MarcoBoschi »

Hi,
maybe someone have already translate this function from delhpi to fivewin?

https://stackoverflow.com/questions/677867/run-application-or-process-on-a-remote-computer

I'd like to test just one thing

many thanks
marco
Marco Boschi
info@marcoboschi.it
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: How many time my application is run in memory (SOLVED)

Post by Jimmy »

hi,

WMI can access "REMOTE" ... but you need "Rights"

this is Xbase++ Code

Code: Select all | Expand

   IF VAL( OS(OS_VERSION) ) > 6
      IF strComputer == "Localhost"
         objWMIServices  := CreateObject( "WbemScripting.SWbemLocator" ):ConnectServer(strComputer, "Root\CIMv2")
      ELSE
         IF EMPTY(cPassword)
            MSGBOX("Need Password")
            QUIT
         ELSE
            objWMIServices  := CreateObject( "WbemScripting.SWbemLocator" ):ConnectServer(strComputer, "Root\CIMv2",strComputer+"\"+cUser,cPassword)
         ENDIF
      ENDIF
   ELSE
      objWMIServices  := GetObject("
WinMgmts:{impersonationLevel=impersonate}\\"+strComputer+"\Root\CIMv2")
   ENDIF

Is it possible to read Open Files in Shared folders via WMI?. (My Computer, Manage, System Tools, Shared folder, Open Files)

as i know you "can" find out "share" Files ... but only "on Server"
greeting,
Jimmy
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: How many time my application is run in memory (SOLVED)

Post by MarcoBoschi »

Hi Jimmy i've tried but I'm not capable :(
I'd Like to test a function to launch some applications server side
many thanks
marco
Marco Boschi
info@marcoboschi.it
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: How many time my application is run in memory (SOLVED)

Post by Jimmy »

hi,

you need to enable "winrm" Service on Remote PC

try Powershell on Remote PC and check with

Code: Select all | Expand

get-service winrm


If it is stopped, type:

Code: Select all | Expand

enable-PSRemoting -force


Add access permission to the remote host.

Code: Select all | Expand

winrm s winrm/config/client '@{TrustedHosts="REMOTECOMPUTERNAME/IP"}'


REMOTECOMPUTERNAME = Name "see" under Network
IP = 192.xxx.xxx.xxx

---

also Windows Firewall is blocking the Remote Access.
goto Firewall and select WMI
Image
when all is enable try

Code: Select all | Expand

get-wmiobject CIM_Memory -computername "192.xxx.xxx.xxx" -credential "username"

you will ask for Password ... and hope now you got access of Memory Information

---

when all work in Powershell you can run you harbour App
Last edited by Jimmy on Mon May 30, 2022 1:24 pm, edited 1 time in total.
greeting,
Jimmy
User avatar
MarcoBoschi
Posts: 1071
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: How many time my application is run in memory (SOLVED)

Post by MarcoBoschi »

8)
Marco Boschi
info@marcoboschi.it
User avatar
Otto
Posts: 6404
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 24 times
Been thanked: 2 times
Contact:

Re: How many time my application is run in memory (SOLVED)

Post by Otto »

Hello Jimmy,
maybe you can just explain what the difference is between RDP and run remote as described here?

Where is the screen displayed when "Run remotely".

Kind regards
Otto

PS: What about a Tirol holiday?
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: How many time my application is run in memory (SOLVED)

Post by Jimmy »

hi Otto,

using WMI "just" get Hard-/Software Information of PC, no Screen or "Input"
greeting,
Jimmy
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: How many time my application is run in memory

Post by Jimmy »

hi,
Horizon wrote:Is it possible to read Open Files in Shared folders via WMI?. (My Computer, Manage, System Tools, Shared folder, Open Files)

i need to know "Win32_xxx" to "generate WMI Code using "WMI Code Creator"
https://www.microsoft.com/en-us/download/details.aspx?id=8572
it will not "generate" xBase OOP Code but it it easy to "translate"

if you tell me which "Win32_xxx" you are looking for i can "generate" xBase OOP Code

---

"on Server" you can run

Code: Select all | Expand

compmgmt.msc
look at "Share Folder" -> "Session" and/or ""Open Files"
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: How many time my application is run in memory (SOLVED)

Post by Antonio Linares »

Dear Marco,

Using Harbour hbnetio you can execute remote Harbour code on the server.

Ritzan explained that to us recently
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply