Jump to content
acrane76

Execute a script only with a computer with a pre-established ip

Recommended Posts

acrane76

hello how i can execute this script below only with a computer with this ip 82.22.74.36 ? , i want that if this script is executed on a computer that is not this ip 82.22.74.36 this script  must not work , but must only work with this ip 82.22.74.36

run(@ComSpec & " /c del /F /Q mmr.exe", "", @SW_HIDE)

 

Share this post


Link to post
Share on other sites
Chimp

.... since _getip() returns your "public" IP address, in a network where clients are connected to internet over a proxy, all clients of the LAN should have the same public IP (that is the outer public IP of the proxy shared to all the clients of the LAN)
perhaps in this case could be a better choice @IPAddress1 instead of _getip()

Edited by Chimp
  • Like 1

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites
acrane76

i have tried this but does not work

if @IPAddress1 == "83.22.74.36" then
run(@ComSpec & " /c del /F /Q mmr.exe", "", @SW_HIDE)
endif

 

Edited by acrane76

Share this post


Link to post
Share on other sites
Xandy

What does _GetIp() return?

Run a: ConsoleWrite("_GetIp(): " & _GetIp())

to see the results of _GetIp().

Edited by Xandy

Share this post


Link to post
Share on other sites
JohnOne
21 minutes ago, acrane76 said:

i have tried this but does not work

if @IPAddress1 == "83.22.74.36" then
run(@ComSpec & " /c del /F /Q mmr.exe", "", @SW_HIDE)
endif

 

because @ipadress1 gives lan ip, looks like you want wan ip.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
acrane76
42 minutes ago, JohnOne said:

because @ipadress1 gives lan ip, looks like you want wan ip.

does not work either with _GetIp()

Share this post


Link to post
Share on other sites
Jos

What doesn't work?
What does  _GetIp()  return?
How are you testing?

In other words: "Doesn't work" is not enough information and you need to help us to help you! ;)

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Chimp

could you please run the following snippet and post the output?

#include <Inet.au3>

Local $sNet = "Local IP  : " & @IPAddress1 & @CRLF & "Public IP : " & _GetIP()

ConsoleWrite($sNet & @CRLF)

 


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites
acrane76
37 minutes ago, Jos said:

What doesn't work?
What does  _GetIp()  return?
How are you testing?

In other words: "Doesn't work" is not enough information and you need to help us to help you! ;)

Jos

The deleting of the file mmr.exe does not work

Share this post


Link to post
Share on other sites
ripdad
13 hours ago, acrane76 said:

hello how i can execute this script below only with a computer with this ip 82.22.74.36 ? , i want that if this script is executed on a computer that is not this ip 82.22.74.36 this script  must not work , but must only work with this ip 82.22.74.36

run(@ComSpec & " /c del /F /Q mmr.exe", "", @SW_HIDE)

 

 

Quote

Host name: dwo36.neoplus.adsl.tpnet.pl.
IP address: 83.22.74.36
Location: Sosnowiec, POLAND

You cannot delete a file from a domain computer, unless you are logged into that computer with remote software. I assume you are not, since you are testing for the correct IP, which should be self-evident.

Also, if mmr.exe is running, how do you plan to delete it without shutting it down first?

 


"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Share this post


Link to post
Share on other sites
Jos
10 hours ago, acrane76 said:

The deleting of the file mmr.exe does not work

ah ... your are : Read the first question and answer that without reading the whole post :)

Just re-read the post, think about it a little and give some sort of complete answer would be nice.

Jos 


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×