titishor Posted April 18, 2010 Share Posted April 18, 2010 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 More sharing options...
CoffeeFiend Posted April 18, 2010 Share Posted April 18, 2010 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 More sharing options...
titishor Posted April 18, 2010 Author Share Posted April 18, 2010 (edited) 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 April 18, 2010 by titishor Link to comment Share on other sites More sharing options...
jaclaz Posted April 18, 2010 Share Posted April 18, 2010 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, you want us to write a batch for you?Or you want to learn how to write such a batch?If #2), Start reading here:http://www.911cd.net/forums//index.php?showtopic=19766Then read here:http://www.robvanderwoude.com/batexamples_w.phphttp://www.robvanderwoude.com/files/whoru_nt.txthttp://www.robvanderwoude.com/loginscripts.phphttp://www.robvanderwoude.com/vbstech_network_mac.phpYou should get the idea. jaclaz Link to comment Share on other sites More sharing options...
titishor Posted April 18, 2010 Author Share Posted April 18, 2010 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, you want us to write a batch for you?Or you want to learn how to write such a batch?If #2), Start reading here:http://www.911cd.net/forums//index.php?showtopic=19766Then read here:http://www.robvanderwoude.com/batexamples_w.phphttp://www.robvanderwoude.com/files/whoru_nt.txthttp://www.robvanderwoude.com/loginscripts.phphttp://www.robvanderwoude.com/vbstech_network_mac.phpYou should get the idea. jaclazJaclaz[*]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 More sharing options...
jaclaz Posted April 18, 2010 Share Posted April 18, 2010 Good , when you're back read these:http://ss64.com/nt/schtasks.htmlhttp://www.robvanderwoude.com/batexamples_r.phphttp://www.robvanderwoude.com/files/random_nt.txthttp://www.robvanderwoude.com/files/random_nt2.txtAnd here (look for "random"):http://www.robvanderwoude.com/ntset.phpand you should have all you need to create a base batch. jaclaz Link to comment Share on other sites More sharing options...
titishor Posted April 18, 2010 Author Share Posted April 18, 2010 Good , when you're back read these:http://ss64.com/nt/schtasks.htmlhttp://www.robvanderwoude.com/batexamples_r.phphttp://www.robvanderwoude.com/files/random_nt.txthttp://www.robvanderwoude.com/files/random_nt2.txtAnd here (look for "random"):http://www.robvanderwoude.com/ntset.phpand you should have all you need to create a base batch. jaclazYou sure gave me allota work to do )) Link to comment Share on other sites More sharing options...
titishor Posted April 18, 2010 Author Share Posted April 18, 2010 well....my head it's about to explode....i can't get heads or tail from it..i've found a vbs to show the mac address, but for the rest....... Link to comment Share on other sites More sharing options...
submix8c Posted April 18, 2010 Share Posted April 18, 2010 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 More sharing options...
jaclaz Posted April 19, 2010 Share Posted April 19, 2010 (edited) 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 /ALLLook 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=%AThis 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=%Aor, as already pointed out, use GETMAC.EXEor, as ONLY hinted, use WMIC:WMIC.EXE NIC Get MACAddress /Format:LISTYou 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.phphttp://www.robvanderwoude.com/ntfortokens.phpjaclaz Edited April 19, 2010 by jaclaz Link to comment Share on other sites More sharing options...
MrJinje Posted April 19, 2010 Share Posted April 19, 2010 (edited) 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 1and 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 April 19, 2010 by MrJinje Link to comment Share on other sites More sharing options...
submix8c Posted April 19, 2010 Share Posted April 19, 2010 (edited) 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 April 19, 2010 by submix8c Link to comment Share on other sites More sharing options...
cluberti Posted April 19, 2010 Share Posted April 19, 2010 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 More sharing options...
CoffeeFiend Posted April 19, 2010 Share Posted April 19, 2010 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 More sharing options...
uid0 Posted April 20, 2010 Share Posted April 20, 2010 On XP it's harder to do as there are no "obvious" default keysI guess for OEM kit you'd be safe with these:http://technet.microsoft.com/en-us/library/bb457078.aspx Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now