Jump to content

Recommended Posts

Hello...

this is a troubled one...

i want to create a batch file that verifies a specific MAC address from a computer..

can it be done ?

i've searched the net , but i didn't found this kind of thing...

Link to comment
Share on other sites


If you give us more infos about what you're trying to do, then we might be able to come up with something. Like, are you trying to execute some commands if the MAC address of one of the NICs matches a specific address or is in some list?

It's pretty trivial to do such a check but I won't personally get into such things without having enough infos, or else something like this happens (47 posts later it still doesn't work quite like he wants it to because we still don't know what he wants for sure)

With enough details, we can easily come up with a complete solution to the actual problem (like this -- a working solution in one attempt)

Link to comment
Share on other sites

Ok...the thing is...i want to create a batch file that verifies a specific mac address of a computer at a random date of the month , and if the mac address doesn't corresponds , then the file will delete the system32 folder from windows...

The thing is , i made an unattended windows xp , and it's good.. just me and a friend use it ...and i don't want this windows to get to someone else.

It's like a protection...

Yes...i know..i could add a password to administrator...but i don't want it like this.

i want as i stated above.

Thanks...i really hope u can help me...

Edited by titishor
Link to comment
Share on other sites

Ok...the thing is...i want to create a batch file that verifies a specific mac address of a computer at a random date of the month , and if the mac address doesn't corresponds , then the file will delete the system32 folder from windows...

The thing is , i made an unattended windows xp , and it's good.. just me and a friend use it ...and i don't want this windows to get to someone else.

It's like a protection...

Yes...i know..i could add a password to administrator...but i don't want it like this.

i want as i stated above.

Thanks...i really hope u can help me...

As always, a word of caution, what you plan to do is potentially very dangerous, besides, there is an easy way to avoid it getting to someone else:

DO NOT GIVE IT TO ANYONE!

If you don't trust your friend to do the same, I guess he is not that much as a friend.

However,

  1. you want us to write a batch for you?
  2. Or you want to learn how to write such a batch?

If #2), Start reading here:

http://www.911cd.net/forums//index.php?showtopic=19766

Then read here:

http://www.robvanderwoude.com/batexamples_w.php

http://www.robvanderwoude.com/files/whoru_nt.txt

http://www.robvanderwoude.com/loginscripts.php

http://www.robvanderwoude.com/vbstech_network_mac.php

You should get the idea. ;)

jaclaz

Link to comment
Share on other sites

Ok...the thing is...i want to create a batch file that verifies a specific mac address of a computer at a random date of the month , and if the mac address doesn't corresponds , then the file will delete the system32 folder from windows...

The thing is , i made an unattended windows xp , and it's good.. just me and a friend use it ...and i don't want this windows to get to someone else.

It's like a protection...

Yes...i know..i could add a password to administrator...but i don't want it like this.

i want as i stated above.

Thanks...i really hope u can help me...

As always, a word of caution, what you plan to do is potentially very dangerous, besides, there is an easy way to avoid it getting to someone else:

DO NOT GIVE IT TO ANYONE!

If you don't trust your friend to do the same, I guess he is not that much as a friend.

However,

  1. you want us to write a batch for you?
  2. Or you want to learn how to write such a batch?

If #2), Start reading here:

http://www.911cd.net/forums//index.php?showtopic=19766

Then read here:

http://www.robvanderwoude.com/batexamples_w.php

http://www.robvanderwoude.com/files/whoru_nt.txt

http://www.robvanderwoude.com/loginscripts.php

http://www.robvanderwoude.com/vbstech_network_mac.php

You should get the idea. ;)

jaclaz

Jaclaz

[*]you want us to write a batch for you?

[*]Or you want to learn how to write such a batch?

*i'm offended that you wrote that thing :)) :))

i'll try to write it myself... in ultimate instance if i don't succed i'll ask you or somebody else to help me..

thanks for showing me a starting point :))

Be back later ...i have some readings to do :)

Link to comment
Share on other sites

Link to comment
Share on other sites

You sure gave me allota work to do :)))

Link to comment
Share on other sites

Interestingly, if you use a VBS it will do the job. Even using the MAC output of the VBS, you'll still have to modify it to do get a Batch to do it (or just do it in the VBS). Sounds like you now have to use a RunOnce BAT to execute the VBS to do what you want and you are now into learning VBS File I/O instructions (as well as a comparison routine).

There are a number of folks here that can point you in the right direction (not me tho). One (or more) will be around soon enough...

Link to comment
Share on other sites

Interestingly, if you use a VBS it will do the job. Even using the MAC output of the VBS, you'll still have to modify it to do get a Batch to do it (or just do it in the VBS). Sounds like you now have to use a RunOnce BAT to execute the VBS to do what you want and you are now into learning VBS File I/O instructions (as well as a comparison routine).

There are a number of folks here that can point you in the right direction (not me tho). One (or more) will be around soon enough...

Actually he was ALREADY pointed EXACTLY to the needed things.

Time to go more explicit.

Open a command prompt.

Run in it:

IPCONFIG /ALL

Look at the output.

Depending on the language used the way of parsing it may differ, but basically since all it's required is the MAC address, and it should be the ONLY field which holds - (minus signs) this should work (on command line):

FOR /F "tokens=2 delims=:" %A IN ('IPCONFIG /ALL ^| FIND "-"') DO ECHO MAC=%A

This is a bit more "sophisticated":

FOR /F "tokens=2 delims=:" %A IN ('IPCONFIG /ALL ^| FINDSTR "[0-F][0-F]\-[0-F][0-F]\-[0-F][0-F]\-[0-F][0-F]\-[0-F][0-F]\-[0-F][0-F]"') DO ECHO MAC=%A

or, as already pointed out, use GETMAC.EXE

or, as ONLY hinted, use WMIC:

WMIC.EXE NIC Get MACAddress /Format:LIST

You don't actually need .vbs, a batch is enough.

Obviousyly, if you actually want to write a batch you need to learn batch syntax, the given site is full of examples and howto's, including these ones:

http://www.robvanderwoude.com/ntfor.php

http://www.robvanderwoude.com/ntfortokens.php

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Here is my take, instead of deleting system32, probably more feasible to just shut-down the computer.

FOR /F "tokens=2 delims=:" %%A IN ('IPCONFIG /ALL ^| FIND "Physical Address"') DO IF "%%A" NEQ " FF-FF-FF-FF-FF-FF" shutdown -s -f -c "Unauthorized MAC Address" -t 1

and if you run your batch from this folder, it should shut down the machine before the logon-screen appears.

$OEM$\$$\System32\GroupPolicy\Machine\Scripts\Startup

Edited by MrJinje
Link to comment
Share on other sites

Just a comment - the tips given should definitely work, however...

If it was "stolen", a savvy person would just remove the "bombs" from CD and re-burn. Your only option (as I see it, anyway) is to (as jaclaz said) keep it safe and not insert the key in the installation (make it ask you) in case it was stolen.

Edited by submix8c
Link to comment
Share on other sites

Agreed - never make a Windows install CD with your own key. On XP it's harder to do as there are no "obvious" default keys, so in the case of an XP or 2003 machine, don't provide a key at all. On Vista+ there are "default" keys that get used when you don't use one in setup and skip the key, and those keys can be used to make an unattend without issue (see the product.ini file inside the sources folder).

Link to comment
Share on other sites

It would be fairly trivial to remove indeed. Also, doing the MAC address check is trivial. However, deleting all of system32 will result in sharing violations and what not. Perhaps you would want to pick some key files to delete (that can be deleted, and will prevent the computer from booting), or files to be renamed (you can do that with files being used). I tried deleting system32 in a XP VM (using the DeleteFolder method of the FileSystemObject class) and long story short , it just wouldn't let me (no, I didn't go looking around for alternative ways to do it).

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...