From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Secure the copy of the script to other computers

Solved!
Go to solution

Hello,
I would like to ask how to ensure the spread of the script. My idea was to compare the computer name, but I couldn't come up with the right command. Thank you in advance for all the answers.

 

Pavel

0 Kudos
Message 1 of 3
(1,088 Views)
Solution
Accepted by topic author KOPA

Hi,

 

If you use VBA, the code can be something like this:

Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")
Dim ComputerName : ComputerName = objNetwork.ComputerName
LogFileWrite(ComputerName)

 

If you are using Pyhon:

import socket
ComputerName=socket.gethostname()
print(ComputerName)
Message 2 of 3
(1,081 Views)

@panta1978  ha escrito:

Hi,

 

If you use VBA, the code can be something like this:

Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")
Dim ComputerName : ComputerName = objNetwork.ComputerName
LogFileWrite(ComputerName)

 

If you are using Pyhon: io games

import socket
ComputerName=socket.gethostname()
print(ComputerName)

Thank you so so much. This answer was very very useful to me.

0 Kudos
Message 3 of 3
(1,012 Views)