I'm trying to slim down woat script and this is the results so far Original OEM Activation Code: :OEMACT 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [W7 OEM ACTIVATION] cls title WOAT v3.2 OEM/KMS ACTIVATOR MODE CON COLS=76 LINES=22 echo. ======================================= echo. OEM ACTIVATION. echo. ======================================= echo. for /f "tokens=2 delims==" %%A in ('"wmic bios get version /format:list"') do set VAR=%%A & goto:OEMINS ) :OEMINS echo. cscript /b \windows\system32\slmgr.vbs -ilc "%~dp0Certificates\%VAR%" echo. OEMID SET AND CERT INSTALLATION: [SUCCESS] 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OEMID SET AND CERT INSTALLED] goto:OSDETECT ) ELSE ( goto:INSTALLCERTIFICATE ) :OSDETECT 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS DETECTION START] echo. REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Ultimate" >nul IF NOT ERRORLEVEL 1 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS DETECTION SUCCESS] & echo. OS DETECTION: [SUCCESS] & goto:ULTIMATEOEM REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Professional" >nul IF NOT ERRORLEVEL 1 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS DETECTION SUCCESS] & echo. OS DETECTION: [SUCCESS] & goto:PROFESSIONALOEM REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Home Premium" >nul IF NOT ERRORLEVEL 1 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS DETECTION SUCCESS] & echo. OS DETECTION: [SUCCESS] & goto:HOMEPREMIUMOEM REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Home Basic" >nul IF NOT ERRORLEVEL 1 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS DETECTION SUCCESS] & echo. OS DETECTION: [SUCCESS] & goto:HOMEBASICOEM REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 7 Starter" >nul IF NOT ERRORLEVEL 1 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS DETECTION SUCCESS] & echo. OS DETECTION: [SUCCESS] & goto:STARTEROEM ELSE 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS DETECTION FAIL] & GOTO:FAILURE ) :ULTIMATEOEM 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS ULTIMATE OEM] echo. set keytype=OEM echo. KEY INSTALLATION: [IN PROGRESS..] set os=WINDOWS 7 ULTIMATE OEM set keyw=49PB6-6BJ6Y-KHGCQ-7DDY6-TF7CD cscript /b \windows\system32\slmgr.vbs -ipk %keyw% >nul && goto:DONE goto:NOTDONE ) :PROFESSIONALOEM 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS PROFESSIONAL OEM] echo. set keytype=OEM echo. KEY INSTALLATION: [IN PROGRESS..] set os=WINDOWS 7 PROFESSIONAL OEM set keyw=74T2M-DKDBC-788W3-H689G-6P6GT cscript /b \windows\system32\slmgr.vbs -ipk %keyw% >nul && goto:DONE goto:NOTDONE ) :HOMEPREMIUMOEM 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS HOME PREMIUM OEM] echo. set keytype=OEM echo. KEY INSTALLATION: [IN PROGRESS..] set os=WINDOWS 7 HOME PREMIUM OEM set keyw=6RBBT-F8VPQ-QCPVQ-KHRB8-RMV82 cscript /b \windows\system32\slmgr.vbs -ipk %keyw% >nul && goto:DONE goto:NOTDONE ) :HOMEBASICOEM 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS HOME BASIC OEM] echo. set keytype=OEM echo. KEY INSTALLATION: [IN PROGRESS..] set os=WINDOWS 7 HOME BASIC OEM set keyw=DX8R9-BVCGB-PPKRR-8J7T4-TJHTH cscript /b \windows\system32\slmgr.vbs -ipk %keyw% >nul && goto:DONE goto:NOTDONE ) :STARTEROEM 1>>%userprofile%\Desktop\WOATv3.2LOG.log echo.[%date% %time%] [OS STARTER OEM] echo. set keytype=OEM echo. KEY INSTALLATION: [IN PROGRESS..] set os=WINDOWS 7 STARTER OEM set keyw=36Q3Y-BBT84-MGJ3H-FT7VD-FG72J cscript /b \windows\system32\slmgr.vbs -ipk %keyw% >nul && goto:DONE goto:NOTDONE ) I slimed it down to this: Code: :oemact set acttype=OEM 1>>%userprofile%\Desktop\WOATv3.3LOG.log echo.[%date% %time%] [OEM Activation Started] cls title WOAT v3.3 OEM/KMS Activator mode con cols=76 lines=22 echo. ---------------------------------------------------------- echo. OEM Acitvation Started. echo. ---------------------------------------------------------- echo. for /f "tokens=2 delims==" %%A in ('"wmic bios get version /format:list"') do set VAR=%%A cscript /b \windows\system32\slmgr.vbs -ilc "%~dp0Certificates\%VAR%" echo. OEMID Set and Cert Installation: [Success] 1>>%userprofile%\Desktop\WOATv3.3LOG.log echo.[%date% %time%] [OEMID Set and Cert Installed] FOR /F "tokens=3" %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID"') DO SET os=%%A 1>>%userprofile%\Desktop\WOATv3.3LOG.log echo.[%date% %time%] [OS Edition: %os%] echo. OS Edition: %os% echo. Product Key Installation: [In Progress] if %os% equ Ultiate set wkey=49PB6-6BJ6Y-KHGCQ-7DDY6-TF7CD if %os% equ Professional set wkey=74T2M-DKDBC-788W3-H689G-6P6GT if %os% equ HomePremium set wkey=6RBBT-F8VPQ-QCPVQ-KHRB8-RMV82 if %os% equ HomeBasic set wkey=DX8R9-BVCGB-PPKRR-8J7T4-TJHTH if %os% equ Starter set wkey=36Q3Y-BBT84-MGJ3H-FT7VD-FG72J cscript /b \windows\system32\slmgr.vbs -ipk %wkey% >nul if errorlevel 1 goto:Error goto:success wow! a huge change don't you think? lol, if there any way possible to simplify more? Please let me know thanks
Hi all, Does anyone help me to have a script .BAT or .CMD to restore the tokens.dat file and product key in Windows Vista instead of replace this file in Safemode please ? Path: C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\SoftwareLicensing\tokens.dat Thanks in advance
That batch has an argument, so you can't run it with just a double-click and expect it to work. And because it is intended to run from a CMD window, there's no need for a "pause" command.
You script accepts only "5" as an argument and the diamond is hard-coded. I believe that the original intention of the challenge was a batch script that would dynamically generate a diamond based on an argument. diamond.bat 5 should return Code: 0 0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 0 1 2 3 0 1 2 0 1 0 While diamont.bat 3 should return Code: 0 0 1 0 1 2 0 1 2 3 0 1 2 3 0 1 2 0 1 0 diamond.bat 2 Code: 0 0 1 0 1 2 0 1 2 0 1 0 etc.
@rEApEAt You know what "eg." means? It means for example - which implies that it should be able to generate for other numbers as well.
This is becoming surreal - and, at least for me, a bit comic. Yes, I know what "eg." means. I even know how to analyse a very simple problem like this one. "Write a batch file that takes one argument to display a diamond in numbers". The batch file must display a diamond in numbers taking one - and only one - argument. Nothing here disallows the use of a hard-coded diamond. "The single argument should be number." The argument must be necessarily 1, 2, 3, 4, 5, 6, 7, 8 or 9. "Eg. diamond.bat 5 will give the following output". According to the precedent proposition, it's indifferent to use "diamond 1", "diamond 2", "diamond 3", "diamond 4", "diamond 5", "diamond 6", "diamond 7", "diamond 8" or "diamond 9". Hence, it may be - for example - "diamond 5". In your first post, you have said that my solution is not working; but it works. In the second post, you have said that the "original intention" of the challenge is different, which implies that I'm not able to interpretate a problem, or that MasterDisaster could not know how to properly formulate a problem. In the third post, you're suggesting I'm not able to understand plain english. I hope the fuss will end here.
Surreal I agree, and indeed quite comic. Why would MasterDisaster give such a ridiculously simple "challenge"? There is no challenge in hard-coding a diamond in a batch script. See the logic? This is what your script does: Code: echo 0 echo 0 1 echo 0 1 2 echo 0 1 2 3 echo 0 1 2 3 4 echo 0 1 2 3 4 5 echo 0 1 2 3 4 5 echo 0 1 2 3 4 echo 0 1 2 3 echo 0 1 2 echo 0 1 echo 0 Your script is just as simple as any "Hello world" script and is no challenge to write at all - but by all means, if you think it is an acceptable solution - that's fine.
At least we agree in one thing: this is becoming more and more funny. Yes, it is an acceptable solution because the challenge was simply to code a simple argument option within a batch file. Replace the diamond with a "Hello World" if you wish, and the challenge will remain just the same! It seems you cannot understand, or accept, the purpose of this thread. It seems you haven't even read its first post. You seem to be decided to deny and depreciate the value of my tiny, simple, humble contribution to this thread. Why? This is the only real question in all this purposeless debate. Solve your own challenge without hard-coding the diamonds and you'll be much more useful for everybody who is hanging here to learn and share knowledge. Of course you would not propose a challenge that you cannot solve by yourself.
You seem very angry. It's obvious that I'm not the only one that thinks this challenge requires more than just a few echoes, see this for example. There's a reason I haven't provided an example, and that is because it is a complex task and would require some time (yes, I'm saying it is difficult - a challenge). I read this as "the number should be used (to) in the generation of the diamond". There is no need for you to agree with me, as I am merely stating my interpretation. You seem to suggest that I have something against you personally, which I obviously don't. Your script is a nice example on how to use arguments, but it is in my opinion not a solution to the challenge. Agree with me or disagree. If you want to continue discussing this, then please reply.
There is no reason to argue with each other both of you are right in that both ways to make the program are good. It doesn't matter how complicated the code is it is still a good script. rEApEAt's code did what the example asked for but like calistoga stated the script could be expanded to use other numbers which is more of a challenge.
An angry person is - by definition - unable to be polite. I do not - and I think that anyone would - agree with your interpretation of the challenge, which is pretty tortuous (the interpretation, not the challenge). Of course, you're entitled to it. On the other hand, you can hardly call what I have said as an "interpretation", because it relies strictly on what was written. In a word, the diamond itself was just what Hitchcock used to call a "MacGuffin". And perhaps no one - not even experienced members - understood the challenge precisely because it was so [censored] simple. It was indeed a challenge for beginners. With a shiny MacGuffin in it to distract the attention. Very well done, I would say. The challenge is in the post #4. Take a look at the previous post (#3) and perhaps you'll realize that you are "looking for a horn in a horse's head" (this is a popular saying in my country). Cheers and let's turn this page.
Ok you guys instead of engaging this dialog which is solving nothing I have project that I need help on. Pm me both if you want to help. I cannot post cause it contains code to create solution for Adobe CS5 unless admins might entertain this .cmd file that will include all three solutions I did this year hence an AIO TS solution with IR4, IORRT and CS5T Let me know and let's put our energy into more constructive expression. Maybe you could even collaborate with each other hence take both your awesome scripting talents and merge them in doing something for everybody Appreciation for all coders here TS
Oh TS, we were just getting warmed up Know that I respect your opinions rEApEAt and I may have been wrong
windows text editor is quite rudimentary for making batch files, is there any good free text editors that lets you keep track of lines and columns as you are working your way down the batch? and is there a way to hide the minimise/maximise buttons on the cmd window?
Does anyone know the script in .cmd file to check if ran as admin and to give error if not ran as admin? Thanks