[PowerShell] Sophia Script for Windows 10 & Windows 11 | 5.17.8 | 6.5.8 | x64 2023

Discussion in 'Scripting' started by farag, May 8, 2020.

  1. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,354
    2,308
    60
    C'mon geeser... there is always someone better... at the most he is second best... but credit where credit is due FARAG, FARAG, FARAG, OI.. OI.. OI

    hope you guys are watching the tennis;)
     
  2. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    Who's the first? :)
     
  3. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,354
    2,308
    60
    #203 drew84, Feb 14, 2021
    Last edited: Feb 14, 2021
    “When did I realize I was God? Well, I was praying and I suddenly realized I was talking to myself. ”
    .. ― Peter O'Toole

    ... in case you didn't get this:
    was a compliment
     
  4. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    Ah, LOL. Being not a native sometimes makes troubles. :) Anyway oz-zo much more skilled than me. Better to pray for bim. :)
     
  5. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    Seems I've finished v5.5. At last users will be able to pin these shortcuts: Control Panel, Devices and Printers, and PowerShell withou using syspin. Just pure PowerShell! :evil: Actually if any of you can edit the code you can add your shortcuts. The code is very simple. We're proud to show it for you.
    Brought us many pain while trying to parse and edit exported XML. :evil2:

    Hope, tomorrow I'll upload with a new video made by David.
     
  6. drew84

    drew84 MDL Expert

    Mar 13, 2014
    1,354
    2,308
    60
    .................................. and the script ... please
     
  7. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    #207 farag, Feb 21, 2021
    Last edited: Feb 21, 2021
    (OP)
    v5.5
    • Finally we created the video how to use Sophia Script! Made by @Davidgamerthumbs
    • Also I created a Telegram group if have a question about Sophia Script and too lazy to open an issue on GitHub
    • [​IMG]
    • Allowed languages: English, русский (Russian).

      The PinControlPanel, PinDevicesPrinters, PinCommandPrompt, and UnpinAllStartTiles functions were rewritten into one, PinToStart
    • Now it's possible to pin Control Panel, Device and Printers, and PowerShell shortcuts without using the syspin app — just pure PowerShell! syspin was removed.
    • You can choose what to pin: PinToStart -Tiles ControlPanel, DevicesPrinters, PowerShell or unpin all tiles PinToStart -UnpinAll
    • Updated descriptionsж
    • Fixed typos.
    The next stop is v5.5.1
     
  8. DukiSync

    DukiSync MDL Junior Member

    May 12, 2010
    86
    31
    0
    LTSC 1809 (17763.1728), Sofia script v5.0.4

    Errors: 0 (No Errors)

    Fantastic job, thank you!
     
  9. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    LTSC is not so complicated as another ones. So it pretty hard to make an error. :) Doesn't support by default UWP, OneDrive, and WSL.
    Prepare for the LTSC 2021 that will be released this autumn. As soon as it will be released, I'll delete the current LTSC version. Upgrade!
     
  10. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    https://pastebin.com/raw/stBpAePS
    If you have a web camera (integrated or not), please, post your console output.

    My Surface
    Code:
    Surface IR Camera Front
    Surface Camera Front
     
  11. Davidgamerthumbs

    Davidgamerthumbs MDL Junior Member

    Oct 25, 2020
    65
    149
    0
    [​IMG]
    Am I doing this right?
     
  12. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    Yes. Wrote to you to TG.
     
  13. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    Code:
    Get-CimInstance -ClassName Win32_PnPEntity | Where-Object -FilterScript {($_.PNPClass -eq "Camera") -or ($_.PNPClass -eq "Image")}
     
  14. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    #214 farag, Feb 27, 2021
    Last edited: Feb 27, 2021
    (OP)
    Please test this function. It's almost fully based on this guy research. He wrote a function to make association of any extension with any app with icon set, and generate special Microsoft hash (this is really insane) to prevent the "How do you want to open this?" pop-up appearing.
    The static Microsoft secret string from %SystemRoot%\SysWOW64\shell32.dll is "User Choice set via Windows User Experience {D18B6DD5-6124-4341-9318-804003BAFA0B}" LOL

    On VM it works well.
    https://pastebin.com/raw/GFUz3snK

    How to call function
    Code:
    Set-Association -ProgramPath "C:\Program Files\Notepad++\notepad++.exe" -Extension .cfg -Icon "C:\Program Files\Notepad++\notepad++.exe,0"
    Do not use
    Code:
    %ProgramFiles%
    but
    Code:
    C:\Program Files
    only!
    The app you want to associate with must be installed.

    Generally the icon path looks like
    Code:
    FullPathToEXE,0
    . 0 is the icon index.

    https://stackoverflow.com/a/49256437
     
  15. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
  16. ERRASoft

    ERRASoft MDL Novice

    Aug 17, 2014
    17
    3
    0
    Question
    is this the right way for setupcomplete cmd?

    PowerShell “Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force”
    PowerShell “C:\Windows\Setup\Scripts\Sophia Script\Sophia.ps1”
     
  17. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
    No, as far I know this process isn't "online": it configures the offline volume. But you can try). I was already asked to start thinking about the future, 6.0, version. Users also need to edit local wim file, not online only. But I need to rewrite the whole script. :) As soon as we solve all problems with the current layout for the upcoming SophiApp (did you, guys, see early sketches in the Telegram group?), I'll switch to the next release.
     
  18. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
  19. farag

    farag MDL Member

    Apr 1, 2014
    238
    352
    10
  20. DukiSync

    DukiSync MDL Junior Member

    May 12, 2010
    86
    31
    0
    Ltsc 5.1 - AWESOME! The script is getting better and better every time! I especially like the new concept with the "cleanup" task - reminder! Thank you!
    ...