Solved Cpu key authentication in a batch file

smokyGLINT

Thread Starter
Joined
Apr 23, 2020
Messages
3
Hello everyone, i am not really a person to seek help when it comes to command prompt batch scripts but im having some trouble. im trying to protect the code i have written and i only want some people to use my application. I have my batch file obfuscated already but i wanted to make a password protection sort of deal that works of say windows product key or a mac address. i thought about having the persons credentials coded inside the application so when they open it, the applications pulls their mac address and then compares it to the credentials coded in the application, if they match then it opens up and they can use the application as they please but if it doesnt match it just closes out of the application. Any help would be greatly appreciated.
 
Joined
Sep 21, 2007
Messages
11,983
Some MAC addresses can be changed in Windows, depends on the network card's driver.

And Windows does not reveal it's product key, Otherwise people will start copying them and passing them around.

Some antivirus programs may take a disliking to obfuscated code.

The best way to protect your software is to do what MS is doing, require registration of the program to your server.
 
Last edited:

smokyGLINT

Thread Starter
Joined
Apr 23, 2020
Messages
3
Some MAC addresses can be changed in Windows, depends on the network card's driver.

And Windows does not reveal it's product key, Otherwise people will start copying them and passing them around.

Some antivirus programs may take a disliking to obfuscated code.

The best way to protect your software is to do what MS is doing, require registration of the program to your server.
well the only problem with that is this is a windows batch file and does not connect to a server of any kind. you can pull the windows product key with this command in a batch file or within command prompt "wmic path softwarelicensingservice get OA3xOriginalProductKey". is there a way i could make an authentication based protection with this command?
 

smokyGLINT

Thread Starter
Joined
Apr 23, 2020
Messages
3
Nevermind. I found a way to do an authentication with the windows product key. Thx for the help guys. this is the code i got and it works wonderfully, i would imagine it would work with a mac address as well.



@Echo off

:Auth
SETLOCAL ENABLEDELAYEDEXPANSION
SET count=1
FOR /F "tokens=* USEBACKQ" %%F IN (`wmic path softwarelicensingservice get OA3xOriginalProductKey`) DO (
SET var!count!=%%F
SET /a count=!count!+1
)



if not %var2%== productkeyhere goto fail

Echo Authentication Passed. Access Granted
set /p i=Press Enter to Continue}

:fail
echo Invalid Authentication Key. Access is denied.
set /p p=Press Enter to Continue}

cls & goto Auth

endlocal
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top