Hi everyone. As a begginer I am trying to make my first project on Autoplay Media Studio. I need help how to get Windows Activation Status to showed on a text string For example: Windows Activation Status: Not Activated Windows Activation Status: Activated Hope it was clear enought, to help me. Thank you ---- Better explained on photo what I am looking help for
What have you got so far ? Do you know the command prompt to show the activation status ? Put that script up. I have dabbled in AMS. I have a AMS project which shows some DISM commands. I may well be able to have a go at this for you. Could be fun to try.
Been having a go but sorry not got too far at all. using this command "slmgr -dli" It gets a Pop Up window with the info. In my AMS project i have one button and two inputs. using this LUA code Code: result = CommandLine.Execute("slmgr -dli", 0); Input.SetText("Input1",result.StdOut); Input.SetText("Input2", result.StdError); I just get errors. but putting Code: result = CommandLine.Execute("ping 127.0.0.1", 0); Input.SetText("Input1",result.StdOut); Input.SetText("Input2", result.StdError); I get the info in "input1" I think the problem is "slmgr -dli" gives the pop up and not the info in the command window. I am guessing this is what you want.
The cscript command just forces slmgr(.vbs) to show output directly in CMD window without the nasty pop-up. When using it it needs to specify the slmgr.vbs with extension, else it will error.
I am doing summet wrong ? I have Code: result = CommandLine.Execute("cscript slmgr.vbs -dli", 0); Input.SetText("Input1",result.StdOut); Input.SetText("Input2", result.StdError); Just get error, but the error is in input1. error can you put your LUA up please
Seems you need to specify the full system path in that case: Code: cscript %windir%\system32\slmgr.vbs -dli
Just tested Code: cscript slmgr.vbs -dli in an open command prompt window and the info is there, not in a pop up..
A little further with this now. I copied the "slmgr.vbs" file and put in the root of my AMS project. then using the same layout as above I now get the info to appear in "input1"... So set up a little project, one button. one input and use this LUA code on the button Code: result = CommandLine.Execute("cscript slmgr.vbs /dlv", 0); Input.SetText("Input1",result.StdOut); Input.SetText("Input2", result.StdError); Placing the slmgr.vbs file in the root of the project. A lot of info is given, so more work is needed but maybe you find this useful
woops... forgot i changed it.. code should be Code: result = CommandLine.Execute("cscript slmgr.vbs /dli", 0); Input.SetText("Input1",result.StdOut); Input.SetText("Input2", result.StdError); Just tested it, works really well.
@tnx Thanks a lot for your time and for what you shared It will be very helpful for me I am still trying to learn ... more and more, using AutoplayMS as a begginer as I am. @s1ave77 Thank you too for your time and your correction Also thanks a lot for digital license for Windows 10 Best way to activate Windows ever
I have been messing a little with this.. Lets see if I can explain what i have done.. Make a new AMS project. Add to the project :- 2 x input ----- "input1" "input2" make them both not visible. 1 x label ------"label1" "Checking License Status........" 1 x button on the "click" put this code Code: Label.SetVisible("Label1", true); RunSLMGR = CommandLine.Execute("C:\\Windows\\System32\\cscript slmgr.vbs /dli", 0); Input.SetText("Input1",RunSLMGR.StdOut); Input.SetText("Input2", RunSLMGR.StdError); SLMGRResult = Input.GetText("Input1"); TextFile.WriteFromString("AutoPlay\\Docs\\SLMGR.txt", ""..SLMGRResult, false); SLMGRText = TextFile.ReadToString("AutoPlay\\Docs\\SLMGR.txt"); strSearchIn = ""..SLMGRText; strSearchFor = "Licensed"; -- search for strSearchFor inside strSearchIn nFoundPos = String.Find(strSearchIn, strSearchFor); if nFoundPos >0 then -- found it! Label.SetVisible("Label1", false); Dialog.Message("License Status", " License Status: Licensed "); else -- no luck Label.SetVisible("Label1", false); Dialog.Message("License Status", " License Status: Un-Licensed "); end TextFile.WriteFromString("AutoPlay\\Docs\\SLMGR.txt", "", false); Add to the project a text document called "SLMGR" add via "project\File Layout" Place it in "docs" Add to the root of the project "slmgr.vbs" ( found in C:\Windows\System32 ) this should work then.. it runs slmgr.vbs but because the input1 is set to not visible this runs in the background. Then it writes the result to the slmgr.txt file. then it checks the text file for the word "Licensed" and if it finds it a message pops up confirming the license status. If it does not then another message pops up confirming the unlicensed state. Looking at the code Code: strSearchFor = "Licensed"; if you change Licensed to a different word and test you will see the result.. I have not been able to check this on an un-licensed machine. Hope this helps you in developing your project. Any questions, please ask.
Wow, amazing Very clear and nope, done with the questions. In return hope to help others here in community and being active I will test after, on Windows 10, 7 and 8 Regards and thanks a lot again