Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to execute a .exe in only one machine

Status
Not open for further replies.

Triac

Technical User
Jan 29, 2002
20
IT
Hi,
I almost finished a project and I have to pass the compiled filed to another person that must test it. I have full access to his computer and I'd like to make some trick that prevent the execution of this program under other machines. I don't wanna waste a lot of time, I don't need something very complicate, but It must be quite secure. For example, is there any serial number I can read (maybe from the HardDisk)?
Thanks in advance for your suggestions
 
hi,

try use api(s)

GetComputerName

and/or

GetUserName

make a compare string(s) and on fail exit without
give any explanation.

If the user is smart can change computername (if he has priv) and login as the one you want.
To be sure that the machine is that right, the only
method are: get a cpu-id info (a few cpu have this feature)
and mac-address of nic, but both these method are more complicated for you: try by GetUserName and GetComputerName.

bye
 
There is no need to take a panic as that system's file wlll remain his property unles he gives it access to anyone else.If it is meant to work in single therad then whoever want to access will run their own thread...Complication may be varied upto threading level too. But i don't think so that is required here
 
hi,
sorry, but I don't understand your second post !
In your 1st post you don't speak about thread or property,
but only some computer id (disk,cpu,nic...)

If you put inside program computername that can execute code, only from it will be executed: copy or share
will execute on another computername and your check
will avoid it.

bye

 
Thanks!
The idea to use GetComputerName or GetUserName (better both ;-) ) is very good. It's simple and quite powerful. That's perfect for my task.
Thanks a lot for your quick answer
 
Hi victorv, the second post was not mine.
BTW, thanks to pankajkumer too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top