[Help] How to get windows activation status for Autoplay Media Studio

Discussion in 'Mixed Languages' started by silnwarez, Jun 7, 2018.

  1. silnwarez

    silnwarez MDL Novice

    May 12, 2017
    4
    1
    0
    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 :D

    ----

    Better explained on photo what I am looking help for
    [​IMG]
     
  2. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    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.
     
  3. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    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.
     
  4. s1ave77

    s1ave77 MDL Guide Dog/Dev

    Aug 15, 2012
    15,586
    22,197
    340
    Code:
    cscript slmgr.vbs -dli
    gives the info inside the CMD window.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    Thats very interesting..

    Whats written in the .vbs file ?
     
  6. s1ave77

    s1ave77 MDL Guide Dog/Dev

    Aug 15, 2012
    15,586
    22,197
    340
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60

    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
     
  8. s1ave77

    s1ave77 MDL Guide Dog/Dev

    Aug 15, 2012
    15,586
    22,197
    340
    Seems you need to specify the full system path in that case:
    Code:
    cscript %windir%\system32\slmgr.vbs -dli
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    Just tested

    Code:
    cscript slmgr.vbs -dli
    in an open command prompt window and the info is there, not in a pop up..

    :)
     
  10. s1ave77

    s1ave77 MDL Guide Dog/Dev

    Aug 15, 2012
    15,586
    22,197
    340
    I just answered above your post :D.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    Still getting the error in AMS...

    Needs more looking into.. Later..

    cheers
     
  12. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    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
     
  13. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    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.
     
  14. silnwarez

    silnwarez MDL Novice

    May 12, 2017
    4
    1
    0
    @tnx Thanks a lot for your time and for what you shared :D
    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 :D
     
  15. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,622
    234
    60
    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.
     
  16. silnwarez

    silnwarez MDL Novice

    May 12, 2017
    4
    1
    0
    Wow, amazing :)
    Very clear and nope, done with the questions. :D
    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 :D