Multi OEM/Retail Project

Discussion in 'MDL Projects and Applications' started by The_Guardian, Nov 8, 2014.

Thread Status:
Not open for further replies.
  1. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #181 The_Guardian, Jan 6, 2015
    Last edited: Jan 6, 2015
    (OP)
    It can be added easily to the query tool....wmic bios get serialnumber (this is the service tag number). As far as the url's, I will need help finding those, "if" I decide to add them.

    What is funny on my new HP envy x360 2in1 there is no url at all added nor wallpapers, user image, etc. Seems like with win 8.x they didn't want to bother adding it into the system. The only thing it shows is the HP logo, that's it. Think they just got lazy. lol
     
  2. BALTAGY

    BALTAGY MDL Guide Dog

    Dec 23, 2014
    351
    624
    10
    Can you add a code in OOBE file that can detect the real serial number or service tag and pot it to Computer properties info? it will be great
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #183 The_Guardian, Jan 6, 2015
    Last edited: Jan 6, 2015
    (OP)
    There is a problem with that request....tag numbers are different so how I could do that would take some brain power, if possible. It would have to be queried then added to reg file. This will take some time to think through. Think it would be easier just to let the query tool handle any need info about the system. That is why it was made. Url and tag number added to system properties is not high on my list of things to do but will look into it. To me this is just cosmetic. Like I said my new Hp don't have nothing except the logo.

    Update: I tried adding the tag number but it doesn't show up in properties so not sure how to do your request. Seems like only certain items can be added to show. Think I will leave this info to the query tool for that is why it was created.
     
  4. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    Anyone with new OEM's to add to the project, pm me so I can start adding those to the project. I know skolar has 4 new ones I need to get from him but if anyone else has anymore, contact me by pm so it can be added. :)
     
  5. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,554
    15,642
    270
    "Installed Key" suffice imao. :worthy:
    btw Alpha is put hands on his System Logo Changer, told him to deliver a copy to you as you are the one with skill lol
     
  6. hmmurdock

    hmmurdock MDL Novice

    Mar 30, 2012
    48
    16
    0
    Here's what I'm thinking...

    I'm going to look into adding a simple check at the end of oobe.cmd to add some additional modularity to the project. What I'm thinking is check to see if a few files exist:
    %windir%\Setup\scripts\OEM's\%MAN%\SetupComplete.cmd
    %windir%\Setup\scripts\OEM's\%MAN%\SetupCompleteBefore.cmd
    %windir%\Setup\scripts\OEM's\%MAN%\SetupCompleteAfter.cmd

    If SetupComplete.cmd is found in the OEM folder it will be copied to the "%windir%\Setup\scripts\" folder overwriting the default one if it exists.
    If SetupCompleteAfter.cmd is found in the OEM folder it will be copied to the "%windir%\Setup\scripts\" folder and a line will be appended to the end of SetupComplete.cmd to run SetupCompleteAfter.cmd
    If SetupCompleteBefore.cmd is found in the OEM folder, the SetupComplete.cmd will be renamed to SetupCompleteAfter.cmd, then the SetupCompleteBefore.cmd will be moved and renamed to SetupComplete.cmd (so it will be executed first) and a line will be appended to the new SetupComplete.cmd file to run SetupCompleteAfter.cmd.

    Which sounds kinda complicated but should be fairly easy to implement. The idea being you can still add a SetupComplete.cmd script to run for everything, but if there is something you want run specifically for one brand, you can add it easily.

    This I think will address the Dell Service Tag issue too. Even if a few of the manufacturerers have similar serial numbers that may or may not be useful, I'm pretty sure that not all of them do, so it isn't practical to try and add it for every one. However it would then be trivial to add them just for Dell computers.

    I'll work on it tonight and keep you guys posted.

    (and not saying this should be an official part of the project, but I'm happy to share it with people if they want to make similar modifications)
     
  7. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,554
    15,642
    270
    No worries, we understand you try to collaborate which is a good thing we really appreciate a lot and after all The_Gardian ultimately decides what is goes and what doesn't :D
     
  8. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #188 The_Guardian, Jan 6, 2015
    Last edited: Jan 6, 2015
    (OP)
    I don't know if that would be wise to add since everyone customizes differently. All this is going to do is cause ppl to complain or ask how to edit it. I would rather like to keep it generalized and let end users customize themselves. Plus what if legit machine? You would then need to use Firstlogon.cmd instead if win 8.x or win10. I would rather stay away from customizations. If you wish to customize your own by all means go for it but I don't really want to include it myself into the main project.

    I got the algo added to query tool but since the batch file creates the vbs, I have trouble running the vbs file from the batch. If I manually click on the vbs to query key then dump to txt file, it will run but not from batch file...only if clicked it to run. grrrrr

    Just so everyone knows....in newer oem machines they don't include everything that this project does. Right now we are doing more then the oem's. lol
     
  9. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #189 The_Guardian, Jan 6, 2015
    Last edited: Jan 6, 2015
    (OP)
    Update on the Installed key in registry being dumped using vbs file. The vbs file runs from the batch file but only outputs nothing (blank). I have tried setlocal enabledelayedexpansion, pushd, checked names of files, everything....still no go. The vbs file runs if manually clicking it but the batch file refuses to run it correctly. I have no idea what is wrong for I haven't encounter this before and not much online about it either. Think it is break time.
     
  10. skolar

    skolar MDL Novice

    May 5, 2014
    33
    39
    0
    OOBE.cmd already checks for Manufacturer 'Model' name, and if exists adds the name by registry cmd... it would be easy enough to append serial number or tag in brackets (), next to model name... but hardly worth the effort.
     
  11. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    I agree skolar...also that is why the query tool exists. lol Hey skolar do you have any experience with batch files creating vbs to run? I am having issues and I don't know what is wrong. Maybe I am tired which might be my problem. lol
     
  12. skolar

    skolar MDL Novice

    May 5, 2014
    33
    39
    0
    yeah, some... post me the vbs code & batch code :rolleyes:
     
  13. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #193 The_Guardian, Jan 6, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
  14. hmmurdock

    hmmurdock MDL Novice

    Mar 30, 2012
    48
    16
    0
    Maybe I'm missing something, but I see where you create the QueryKey.vbs file from within the OEM-CD.cmd file, but I don't see where the QueryKey.vbs file is actually run.

    Shouldn't there be a cscript QueryKey.vbs in there somewhere to actually get the VBS file you created to run?
     
  15. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #195 The_Guardian, Jan 6, 2015
    Last edited: Jan 6, 2015
    (OP)
    Under the 100%...

    CALL :InstalledKey
    IF EXISTS ".\QueryKey.vbs" (".\QueryKey.vbs")
    IF EXIST ".\RegKey.txt" for /f "tokens=2 delims=: " %%A in ('find "-" .\RegKey.txt') do (set REGKEY=%%A)
    IF /I "%REGKEY%"=="NBBBB-BBBB-BBBBB-BBBBB" SET REGKEY=Unsupported MAK Key

    I tried adding cscript to the beginning of the vbs file with no good results. I know it has something to do with the cmd file itself not allowing the vbs file to run correctly because if you put :: in front of the del files so you can test you will be able to click on vbs file and it runs and outputs key into txt file, just not from cmd file. I know the search isn't correct yet for finding the key in txt file but until the key outputs to txt file correctly I cant proceed to the search.
     
  16. hmmurdock

    hmmurdock MDL Novice

    Mar 30, 2012
    48
    16
    0
    ECHO SCANNING [-----------#] 100.00^%%
    CALL :InstalledKey
    cscript QueryKey.vbs

    AFAIK you need to run any VBS scripts via cscript. for whatever reason I couldn't get it to work with the "If EXIST" check, but this at least runs through at the moment.
     
  17. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #197 The_Guardian, Jan 6, 2015
    Last edited: Jan 6, 2015
    (OP)
    Still blank in txt file. Seems to be some sort of permission thing that I can see. Since I am a admin I can click on the vbs and it always outputs the txt file with key, just not if running the vbs file in batch file. I have tried pushd, delayedexpansion, etc. without success. Seems it isn't able to write to the txt file to include the key...it creates the txt file but it is blank if running in batch file.
     
  18. hmmurdock

    hmmurdock MDL Novice

    Mar 30, 2012
    48
    16
    0
    #198 hmmurdock, Jan 6, 2015
    Last edited: Jan 6, 2015
    Hmmm.. that's weird. On mine when I ran it without any changes it created the QueryKey.vbs file but didn't execute it. There was no RegKey.txt file in my temp directory at all. It also seemed to abort part way through as I never saw the final screen.

    When I added ran the version above, it went through without error, and only stopped at the screen asking if I wanted to save results.txt The RegKey.txt file was in my %temp% folder and it did contain my install key.

    Very puzzling. I'll keep poking around with it. I'm running on Win7 FWIW.I know on that version and earlier you need the cscript in order to get vbs files to execute from the command line. Perhaps it is different in latter versions but if it's going to be compatible with all, I think the cscript is going to be a necessity.

    Edit: Is there a reason that you have the vbs file created from the same folder as your cmd file, but the regkey.txt is in the %temp% folder? Might you try keeping them in the same location? It would seem to me if you can write to the vbs file in its location then you should be able to write to the txt file in the same folder. Just a thought.
     
  19. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #199 The_Guardian, Jan 6, 2015
    Last edited: Jan 6, 2015
    (OP)
    There are differences in cmd shell in all windows versions and this is and has been a continuing problem but worked itself out over time. I know I have had no issues without using cscript at the beginning. The query tool runs vbs scripts as you can see and they have been working from vista - win10. I know some insist on using it but I have found out is isn't needed for the vbs file will run by itself without needing a command at the beginning. Most only work on one system like win7 but big differences in scripting between win7 and win8.x or win10 for that matter. Welcome to my world. lol :)

    Note: I'm running win 8.1 oem core x64.

    They are both in same directory....
    cd /d "%~dp0" (Temp folder)
    If you show hidden files and folders and goto Temp folder location (remember to put :: in front of the files so not to delete them in the cmd file) you will see both vbs and txt files but the txt file is empty. The vbs file actually runs thus why we have a txt file there but it doesn't run correctly in batch file and that is the problem (blank txt file).

    I am going to try just adding the vbs file to the sfx file and see if cmd file runs it correctly then...maybe its in the creation of the vbs but that doesn't make sense since I can click on the vbs and it runs and outputs txt file with key correctly. It just doesn't make sense to me. lol

    Update: I added the vbs file to sfx file to just run it and not be created by the cmd file but still the same issue so it is in the cmd file where the problem is.
     
  20. hmmurdock

    hmmurdock MDL Novice

    Mar 30, 2012
    48
    16
    0
    Hmmm... that's interesting. I've used cscript for so long I just got accustomed to it, but sure enough it does seem to be working without it after a couple of quick tests. I stand corrected.

    But I will say on my system with the unmodified OEM-CD.cmd file the QueryKey.VBS is created in the same folder as the OEM-CD.cmd file, not in the temp folder. Weirdness.