Page 50 of 94 FirstFirst ... 40484950515260 ... LastLast
Results 491 to 500 of 935

Thread: Windows 10 and Office Excel

  1. #491
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10

    GistStubs of a script to make Windows not suck from Chris and Spooned by me

    This is Thread Post 491 Forum Post 12766
    https://www.excelfox.com/forum/showt...ge50#post12766
    ( link to youtube listings https://excelfox.com/forum/showthrea...ge42#post12685
    https://excelfox.com/forum/showthrea...ge41#post12674
    Link to last post on page 42 https://excelfox.com/forum/showthrea...ge42#post12693
    Link to first post in page 43 https://excelfox.com/forum/showthrea...ge43#post12694
    Link to first post in page 41 https://excelfox.com/forum/showthrea...ge41#post12674 )




    Pull a Plonker #1
    Microsoft Office, Bloatware?? – I doubt it


    I might come back here when I have proved that the modification is necerssary. I don’t want to risk testing this yet, as if I am right and in testing I loose my Microsoft Office, then it can be a real pain to get it back: Despite having all the expensively purchased ( by me) disks with the Keys, Microsoft make virtually impossible to re install more than a couple of times.

    In an earlier live stream video, around minute here and minute here , Chris mentions that he comments out the code line of
    "Microsoft.MicrosoftOfficeHub"
    so as to avoid deleting Microsoft office. On many other occasions he says following lots of request he is not going to delete it in any script of his. Never the less as I write this around Xmas New Year 2021 2022 , its constantly there in his scripts. Possibly its crept in since he is using GitHub to control his versions etc, GitHub IMO is worse than useless

    I have left a few messages and replies to ask about this. I have had no reply and I don’t believe on badgering people who aren’t responding, as with people who are getting too many messages to cope, then it just fuels the situation and makes it worse.

    So this Pull a Plonker #1 is doing this
    # "Microsoft.MicrosoftOfficeHub"





    Pull a Plonker #2
    Push Pull Plonker WAP Properites Telemetry ( "DiagTrack" "dmwappushservice" stuff )
    In this YouTube video at minute 1, Chris talks about disabling a couple of services, https://youtu.be/yXaYszT11CA?t=60
    I expect that these code lines are the implementation of this in
    Code:
     
    Write-Host "Stopping and disabling Diagnostics Tracking Service..." 
    Stop-Service "DiagTrack" -WarningAction SilentlyContinue
    Set-Service "DiagTrack" -StartupType Disabled
    Write-Host "Stopping and disabling WAP Push Service..."
    Stop-Service "dmwappushservice" -WarningAction SilentlyContinue 
    Set-Service "dmwappushservice" -StartupType Disabled
    All well and good.
    But in a later Live Stream video, Redesigning the Windows Toolbox, streamed live on Oct 29, 2021 he added a script bit a bit further down to set a few services to Manual, including these two.
    So either those later two lines ( in # Service tweaks to Manual ) need to be removed, or the above bit should be removed.

    For now I will take out the later lines thus
    Code:
       # Service tweaks to Manual 
     
        $services = @(
        "diagnosticshub.standardcollector.service"     # Microsoft (R) Diagnostics Hub Standard Collector Service
         # "DiagTrack"                                    # Diagnostics Tracking Service        https://i.postimg.cc/ZK23pZyY/Services-MSC-Telemetrie.jpg
        "DPS"
         # "dmwappushservice"                             # WAP Push Message Routing Service (see known issues)  https://i.postimg.cc/t466zfh3/dmwappush.jpg
     
    There is also a possible issue with the Undo Essential Tweaks not putting these back exactly as they were. But maybe I will look at that later ( https://eileenslounge.com/viewtopic.php?f=18&t=37712 )


    Edit later Looking at this issue of the Services, Getting at them, it seems that
    _ you will need PowerShell 7._ to do anything with
    Start up Type AutomaticDelayedStart http://www.eileenslounge.com/viewtop...292019#p292019
    http://www.eileenslounge.com/viewtopic.php?f=18&t=37740

    See also here
    https://excelfox.com/forum/showthrea...ge51#post12777
    Last edited by DocAElstein; 04-01-2022 at 09:44 PM.

  2. #492
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    This is post https://excelfox.com/forum/showthrea...ge50#post12767
    https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12767




    Pull it Plonker #3
    Chris Fucked up a simple change because he was poxing about in GitHub Crap, ( or I am just a jerk for not understanding GitHub yet.. )


    #3a Seems to work
    Disclaimer: I might be talking crap here, because I don’t understand GitHub. On the other hand GitHub could be a complicated waste of time, worse than useless, and it can cause you to mess up a simple change like adding a couple of lines to a script and trying it out.
    Simplified shortened story:
    Someone called nikilson suggested way back in early December a change, basically comprising two code lines to stop the web search being suggested when you search in that small search bar bottom left, https://github.com/nikilson/win10scr...e09a7125868e92

    So before using those code lines you might have this
    https://i.postimg.cc/VNqwtH0M/bollox...web-search.jpg https://i.postimg.cc/rynk54sh/Bollox-to-Web-Search.jpg https://i.postimg.cc/2SvNpXwJ/Bollox-to-Web-Search.jpg

    But if you run a couple of lines like this, either alone or in the full Debloat script, .._
    Code:
    Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0  
    Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "AllowSearchToUseLocation" -Type DWord -Value 0
    _.. , and then the web search bollox is gone
    https://i.postimg.cc/sxXCtj69/No-bollox.jpg https://i.postimg.cc/sDMRm2Z3/Gone-B...Web-Search.jpg
    I have tested that on several computers on a few different Windows 10 versions, including the latest windows 10 version, 21H2. It seems to work, as does the corresponding undo code lines to put it back
    Code:
     Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 1   
     Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "AllowSearchToUseLocation" -Type DWord -Value 1 


    Pullock #3b
    In this live stream video, https://www.youtube.com/watch?v=ZEW5f7F94FY
    9.23 Live - Updating all my GitHub Projects - The Power of FOSS 31 12 2021 https://drive.google.com/file/d/1A29...?usp=drive_web

    , Chris had an attempt at testing the “Pull”:
    At about minute 11, 37 seconds, https://youtu.be/ZEW5f7F94FY?t=697 , he started looking at it, at about minute 23 , https://youtu.be/ZEW5f7F94FY?t=1380 , he put it in some abstract branch twig test GitHub crap, and forgot about it and closed the “Pull request”
    At about minute 57 , https://youtu.be/ZEW5f7F94FY?t=3430 , to fill up time while waiting for something, he tried to test the thing. He ran a Windows 10 virtual machine, and called up the script from the one command thing. As I understand it that runs the current ps1 script somehow across the internet. But Chris never changed that script, ( other than adding a simple single Debloat line HotspotShieldFreeVPN )
    Instead, after adding that simple single Debloat line he …. Before we grab any more requests we will make another branch - ( minute 7 and 30 seconds https://youtu.be/ZEW5f7F94FY?t=450 )
    I think the problem is when pissing about with virtual machines and catastrophic GitHub, you easily loose track of reality. It might look pretty on a video, but to get the job done quickly and efficiently it is very simple:
    _ you can pick up older machines with the older software versions very cheaply. I think anyone working on developing things in windows 10 should have a few computers.
    _ simply test the code lines directly in PowerShell or Windows PowerShell ISE or in a copy of the script.

    The code lines do what they should. Chris was a Branch Test Pullock when he thought he tried them out, ( or I am the slow to get the point idiot, again..)
    Last edited by DocAElstein; 02-17-2022 at 03:37 PM.

  3. #493
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    Plonky Wonk 4 / 2b
    Issues with the Service syntax differences PowerShell 5.1 to 7.1
    http://www.eileenslounge.com/viewtop...292019#p292019
    http://www.eileenslounge.com/viewtopic.php?f=18&t=37740

    Set-Service "dmwappushservice"
    We cant set it back to StartupType AutomaticDelayedStart in PowerShell 5.1. We need PowerShell 7.2. (PowerShell 7.0 and above is a separate install from the built-in PowerShell https://eileenslounge.com/posting.ph...&f=18&p=292019 )
    Chris doesn’t seem to make any attempt to do anything with it in Undo Essential Tweaks)
    Last edited by DocAElstein; 02-08-2022 at 02:42 AM.

  4. #494
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    This is post https://excelfox.com/forum/showthrea...ge50#post12769
    https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12769





    Pulling my Plonkies 5+
    Bollox, it would be easier to start again from scratch

    I have come to a bit of a turning point. Mostly because just now I don’t yet have infinite time available.
    - I got a lot more I want to do this winter.

    Intro. Why am I writing my own script / developing
    I would not have got this far, or no where near as quickly without Chris’s stuff. I remain very grateful to him.
    But its got to the point that his chaotic organising and lack of him having time currently to do justice to the replies, and suggestions that he gets, coupled with the failings of GitHub and YouTube, ( In particular it being almost impossible to comment on YouTube without it being deleted since last July https://support.google.com/youtube/t...comments?hl=en
    GitHub is deigned I think to mess up a project, by not only losing all control, but actively messing up all version control. GitHub is the Devil
    ) … All this means that at the end of the day, its going to be a lot quicker for me to start again from scratch myself.
    His script is full of errors, redundant code and other failings and getting that info across to him has improved to be impossible.
    But he is still a great guy, and I love him!

    But I gotta move on….
    I think this post I am writing in will turn into a table of contents for the next posts

    GUI Redesign Post https://excelfox.com/forum/showthrea...ge50#post12770
    I quite like the GUI idea. It’s convenient. But it’s aimed not to entertain but instead be practical. It is. Its square with simple square labelled button in it. It just need a few simple code lines, a few code lines are needed just once, some others are either in
    _ a loop
    Or
    _ repeated.

    Chris likes to use Posh GUI software to make and control developing/ adding to his GUI. I expect that is due to some reasons such as it looks nice in a YouTube video and other reasons I don’t know.
    But its like swatting a fly with a nuclear missile. It makes a code I expect by recording what you do, just like the VBA macro recorder, you then get a lot of stuff repeated, which then a programmer would reduce into more efficient looping coding or make a function to do similar things in the same coding.
    Personally I don’t mind the extended inefficient text, as text is cheap and it makes it easier later to do mods on a particular button later.
    But I am going to do some looping to do the repeated stuff to get the buttons there,
    mostly because
    _ I want to reduce the code lines, so that I have room to add my new coding but keep some of Chris’s stuff approximately where it is, even if I then #comment it out, as I would like to still follow later what Chris is doing.
    _ Its gonna help me “migrate” from modifying and rearing Chris’s script to having a completely new one of my own
    Last edited by DocAElstein; 02-08-2022 at 02:42 AM.

  5. #495
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    This is post https://excelfox.com/forum/showthrea...ge50#post12770
    https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12770




    Plop #495a)
    A GUI, simple square with a few square buttons, based on a few simple code lines and a bit of looping

    5a) Introduction.
    The thing is like approximately like box with 4 columns of buttons. I might leave it in that form, or add a column or two and move things about a bit.

    The outer window box GUI form thing that comes up:- It’s too dammed fucking big, Chris
    I’ve told him dozens of times so has others. I think he is oblivious to the fact that for most people it blots out the screen making lower buttons unusable. Chris often waffles some crap about automatic re sizing, but I expect he just has some code generated by Posh GUI, which possibly has some redundancy in it, as well as other issues, which he does not understand.
    So bollox to all that. It just takes a few simple code lies to make a simple square that will conveniently fit on most peoples screens. About half the size of what he usually has is ideal, but I will use about two thirds as then I can still see a lot of his buttons on it as I migrate from his coding to my new coding.

    The buttons
    For each button we have a variable of object type. Most of the properties are defined in one go to the variable, (assigned to the variable), but the Click is Added ( the coding that does something) somewhere else. There might be some reason for that, or it might once again just be how Posh GUI chucked it out.
    All the buttons are very simple wide rectangular ones and could all be done in a loop. This has been suggested and written for Chris a few times, but he’s not interested as he like his posh GUI.
    ( jumbled in this section we also have 4 “panels” which for want of a better description seem to be a invisible button with nothing in it, - something like a range, or range object. These 4** are tall things a bit wider than most buttons and extend to the area a bit bigger than to accommodate one of the 4 columns of buttons
    A bit further down we add things, that is to say the corresponding buttons, in these column ranges.
    The actual Form itself seems to act like a range, or can be used as such, so we actual Add the variables to 5** ranges in total.
    We do this Form Controls AddRange first and amongst other things, then add the 4 column Panels to that first. I suppose that makes some sort of hierarchical OOP relesense.

    Generate some stuff with a function.
    As I mentioned previously, I expect the GUI generated coding, as typical from such stuff, gives all things and does not have the sense to group similar things, or come up with something like a single function talking arguments, to do the similar stuff repeatedly. So a lot of stuff is repeated. I am actually untypical in preferring that usually, but I am going to tidy stuff up with a function to give me some spare lines to put my stuff in, whilst keeping some of Chris’s stuff , albeit mostly commented out, for later ease of navigating around his later modifications.

    Etc. etc..
    Last edited by DocAElstein; 02-08-2022 at 02:45 AM.

  6. #496
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    5b) GUI redesign. GUI code Debloat
    _5b) A few obvious minor issues in Chris’s code..
    The Problem/ Characteristic/ Feature/ Reality.
    The GUI, and the use of it in Posh GUI looks great and big and great and awesome in a YouTube Video.
    That’s good enough reason to use it. Chris will and that’s fine by me. All power to him and his YouTube stuff. He has saved me loads of time.

    Post GUI totally fucks up code development. (Use GitHub and the disaster is complete)
    I think its designed to be like the VBA macro(code) generator. It pukes out code for what you do, and / or what you end up with.
    It’s helpful to get you started, but Nothing else in code development. Inevitably you end up with repeated, redundant, contradicting, inefficient coding. Even worse if you continue to use it. It just bloats up to a ridiculous amount.

    A few obvious minor issues in Chris’s GUI related code
    The GUI come up too fucking big.
    _ The .AutoSize = True and .AutoScroll = True are a bit contradictory and cause it to bloat up, and if occasionally the scroll bar appears, it usually vanishes. Its unstable. The .AutoSize = True needs to be removed.
    _ There seems to be two lines to size the GUI. They have the same dimensions. They are a bit different but I expect either one will do

    _ I think Chris sees it at a size that, on average, is a bit smaller than most people see it. I think he uses , on average, a higher screen resolution, which somehow seems to effect the GUI size in his messed up coding. Instead of two code lines giving the dimension of '1050, 1000' , perhaps the simplest of the two with '800, 600' is about right for most people

    _ Some other code lines may have been puked out by Posh GUI and aren’t needed, I am not sure. Some things will be at the default value, and the code lines will reflect this. I probably would not delete those lines as they could be useful to use later if I want to try out non default values, but I would #comment them out.


    Here are the sane code lines for a simple GUI. It will come up in a convenient size, has a scroll bar and you can resize it
    Code:
     Add-Type -AssemblyName System.Windows.Forms
    $Form = New-Object system.Windows.Forms.Form # Create a new form
    $Form.ClientSize = '800, 600' # Define the size
    $Form.AutoScroll= $True # Adds a scroll bar if needed – example if You have added panels ( ranges ) bigger than the size
    $Form.StartPosition = "CenterScreen"# Personal choice if you want it to come up middle screen 
    
    
    
    
    
    
    
    
    
    
    
     [void]$Form.ShowDialog()  # Display the form
    Anything else is bloat
    https://i.postimg.cc/tgH3rXR0/Simple-GUI.jpg https://i.postimg.cc/Y2yQ5N2z/GUI-comes-up.jpg




    _.__________________________________________---------
    ( I am not sure what these two lines do either , other than fuck things up a bit more
    $Form.Width = $objImage.Width
    $Form.Height = $objImage.Height
    )



    See also here:
    GUI Too Fucking big https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page43#post12697
    https://excelfox.com/forum/showthrea...ge43#post12697
    Last edited by DocAElstein; 02-11-2022 at 03:06 AM.

  7. #497
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    _5c) making Buttons (The function to make buttons issue….)
    Its good programming practice apparently to loop similar things rather than having a long list. I don’t personally subscribe to that, not being a good programmer, and most likely never wanting to be one. Most programmers seem a bit screwy, - from harmlessly a bit weird to seriously narcissistic Psychos.
    Text is cheap, so leave it all in I say, preferably in approximately the order you see stuff. Makes it easier to modify individual things, if you want to make it very irregular / diverse, like a dashboard , later.
    But:
    _(i) This is most likely gonna stay very simple – a GUI box with simple buttons on it.
    _(ii) I would like to make myself space, as I would like initially to keep Chris’s stuff there so as to keep up to date and future reference and comparison with what he is doing

    Currently Chris’s code has, for the buttons, a whole lot of repeated crap like this:
    Code:
    $defaultwindowsupdate            = New-Object system.Windows.Forms.Button
    $defaultwindowsupdate.text       = "Default Updates"
    defaultwindowsupdate.width      = 160
    $defaultwindowsupdate.height     = 21
    $defaultwindowsupdate.location   = New-Object System.Drawing.Point(162, 2)
    That makes one button
    At least one chap, A1ex N , has shown Chris how to do that in a function https://github.com/ChrisTitusTech/wi...diff=split&w=0 .
    Chris hasn’t really had time to look at them, and is probably gonna keep using his Posh GUI to generate crap on top of crap. It looks good on video, that’s all.

    It’s not difficult to write such a function. I wrote my own function, after a quick look at what A1ex N did.
    Code:
     # Function to creat button      - idea from a "Pully" thing  https://github.com/ChrisTitusTech/win10script/pull/140/commits/cebd4effb84152b04603cbebe14bc63b2770b0b6?diff=split&w=0
    function Create-Button {param([string]$Text, [int]$FntSz, [int]$Width, [int]$Height, [int]$ClmX, [int]$RwY)#As Object   # This function allows us to make a buttons in one line.                                                                                              (Those later single lines do not make the button appear
    $Btn.Text = $Text
    $Btn.Width = $Width   ;  $Btn.Height = $Height
    $Btn.Location = New-Object System.Drawing.Point($ClmX, $RwY)                                                        
    $Btn.Font = New-Object System.Drawing.Font('Arial', $FntSz)
    return $Btn   }
    Having done that function, then a single following code line of this form will "make" a single button. In other words the following does the equivalent of that previous button code example
    Code:
     $defaultwindowsupdate = Create-Button -Text "Default Updates" -fntsz 11 -Width 160 -Height 21 -ClmX 162 -RwY 2
    That is not quite the full final story. Some of the following final steps could also be tidied up with a function. But I don’t bother: In fact putting all the short commands on a single line makes it look very similar to if I had done a function…

    "Pinning" the buttons somewhere
    Although the argument syntax of the button has those location parameters, _ 162, 2 _ , they are not yet referring to anywhere. It might be a reasonable Laymen thought that they are automatically referring to somewhere in the GUI. But it just doesn’t work like that. There is no reference to the GUI specifically. One good reason for that will be soon obvious.
    We could just make the co ordinates refer to the GUI box like this
    $Form.controls.AddRange(@($defaultwindowsupdate))
    The convention would then be that the co-ordinates refer to 0, 0 being at top left of the GUI. In this example we would be 162 across to the right from top left of the GUI and 2 down, from top left of the GUI. So we could do that, - but we usually don’t …_
    Panels
    _... its usually more convenient to split the GUI into "Panel"s, which as the name suggests are areas, rectangular, and we put a group of things such as a set of buttons, for example those related to similar things, in. This is more for convenience than anything else. We could for example change the location of a panel which would then automatically move all those buttons in one go.
    The way that works then is that you
    _ make the Panels
    _ Use the code line of the form $Form.controls.AddRange(@($Panel1, $Panel2, ……….)) to put the Panels rather than the buttons in the GUI, ( The which itself could be regarded as a Panel )
    _ Finally, the buttons would be added to their respective Panel with similar , $Panel1 .controls.AddRange(@($Panel1, $Panel2, ……….)) , $Panel2.controls.AddRange(@($Panel1, $Panel2, ……….))
    , …etc.. code lines

    Here’s the current code lines, which I will probably change them a bit over the next few posts. Chris used 4 main column Panels. I have currently 5 column panels and another smaller panel somewhere around middle / top right.

    Code:
    $Panel4 = New-Object system.Windows.Forms.Panel ; $Panel4.height = 60 ; $Panel4.width = 350 ; $Panel4.location = New-Object System.Drawing.Point(380,25) # around top right / middle top 
    $Panel2B = New-Object system.Windows.Forms.Panel ; $Panel2B.location = New-Object System.Drawing.Point(550,50) ;$Panel2B.height = 938 ; $Panel2B.width = 120  # 5th column                                                                                                                                                                                       # $Form.Width                   = $objImage.Width
    $Panel2 = New-Object system.Windows.Forms.Panel ; $Panel2.location = New-Object System.Drawing.Point(420,50) ;$Panel2.height = 938 ; $Panel2.width = 120    # 4th column                                                                                                                                                                # $Form.Height                  = $objImage.Height
    $Panel3 = New-Object system.Windows.Forms.Panel ; $Panel3.location = New-Object System.Drawing.Point(250,50) ; $Panel3.height = 939 ; $Panel3.width =200 # 3rd column
    $Panel1 = New-Object system.Windows.Forms.Panel ; $Panel1.location = New-Object System.Drawing.Point(0,50) ; $Panel1.height = 939 ; $Panel1.width = 120 # 1st column
    $PanelB = New-Object system.Windows.Forms.Panel ; $PanelB.location = New-Object System.Drawing.Point(125,50) ; $PanelB.height = 939 ; $PanelB.width = 120 # 2nd column                          #$Panel1.height                   = 939 #  939
    
    
    
    
    
    $Form.controls.AddRange(@($Panel10,$Panel1,$PanelB,$Panel2,$Panel2B,$Label3,$Label15,$Panel4,$PictureBox1,$Label1,$Label4,$Panel3,$ResultText,$Label10,$Label11,$urlfixwinstartup,$urlremovevirus,$urlcreateiso))
    
    $Panel1.controls.AddRange(@($PS,$PS7_2,$notepad,$firefox,$gchrome,$mpc,$vlc,$powertoys,$winterminal,$vscode,$Label2,$everythingsearch,$vscodium,$imageglass,$gimp,$Label7,$Label8,$Label9,$advancedipscanner,$putty,$etcher,$translucenttb,$githubdesktop,$discord,$autohotkey))
    $PanelB.controls.AddRange(@($brave,$7zip,$sharex,$adobereader,$vlc,$powertoys,$everythingsearch,$sumatrapdf,$imageglass,$gimp,$Label7,$advancedipscanner,$putty,$etcher,$translucenttb,$githubdesktop,$discord,$autohotkey))       
    $Panel2B.controls.AddRange(@($darkmode,$performancefx,$lightmode,$essentialundo,$EActionCenter,$ECortana,$RBackgroundApps,$HTrayIcons,$EClipboardHistory,$ELocation,$InstallOneDrive,$WarningLabel,$Label5,$EHibernation))
    $Panel2.controls.AddRange(@($RestorePt,$essentialtweaks,$0andOShup,$TeleRegTweaks,$servicetweaks,$backgroundapps,$cortana,$actioncenter,$darkmode,$onedrive,$lightmode,$removebloat,$WarningLabel,$appearancefx,$STrayIcons,$dualboottime))
    $Panel3.controls.AddRange(@($yourphonefix,$Label6,$windowsupdatefix,$ncpa,$oldcontrolpanel,$oldsoundpanel,$OldSystemPanel,$reinstallbloat))                                                                                                                                                                                 # MissingEndParenthesisInSubexpression
    $Panel4.controls.AddRange(@($defaultwindowsupdate,$securitywindowsupdate,$Label16,$Label17,$Label18,$Label19))
    Last edited by DocAElstein; 02-08-2022 at 03:32 PM.

  8. #498
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    Current stand. Last remnants of Chris’s coding
    The uploaded file is Chris’s script, messed around a lot with a few other things added
    I did it as part of my PowerShell scrip learning.
    But its still useful for future Re reference as I want to continue to follow Chris’s work and contribute if I can, to help.

    On the next page, or more likely the over next page, #52, I will start from scratch I think

    The rest of this page, #50, and most of the next page, #51, will probably be used for notes on
    _ a few issues I might try to get across to Chris,
    and/ or
    _ just general issues related to further development of mine and Chris’s script



    This is what that code will bring up
    https://postimg.cc/Lqfq6kxH https://i.postimg.cc/pdcKCq8n/Last-C...script-GUI.jpg
    Last Chris related script GUI.jpg



    This is typically how it come up on screens with resolution 1366x768 and 1440x900
    https://i.postimg.cc/RCfDbDyz/Temp4-ps1-1366x768.jpg https://i.postimg.cc/65f1BGBj/Temp1-in-1440x900.jpg










    Share ‘Temp2.txt’ https://app.box.com/s/t7utchjkhoxto56tqtnbx9f4vovav5r8
    Share ‘Temp2.ps1’ https://app.box.com/s/un0oxan387v5azqb7t18yu0lu87k2v97

    Last edited by DocAElstein; 03-17-2022 at 01:27 AM.

  9. #499
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    This is post #499 https://excelfox.com/forum/showthrea...ge50#post12774
    https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12774





    So at about the start of February, I was thinking of starting my own Tool from scratch, looking something like the pics from the last post. But I went off to learn PowerShell script a bit better, and do a few other things until about mid March.
    Chris updated a few times during this period, so this post is a History to keep me in touch. I may not add the things or changes Chris made. But I may adjusts my lines to , for example add spaces where he inserted stuff. This is so I can still relate my script to his in the future..**

    Friday, 11 Feb., 2022 Update
    On the Friday, 11 Feb., 2022, Chris did his Live stream on the Tool, … 9.30 Live - Toolbox Update - New Features (Disable_Enable Updates)-WRg5nItpghA_11 02 2022
    https://www.youtube.com/watch?v=WRg5nItpghA
    https://drive.google.com/file/d/1kNQ...?usp=drive_web
    https://drive.google.com/file/d/1khe...?usp=drive_web


    I have taken my last temporary file up to Temp 4, Temp4.ps1 , to take account of this. But I am not adding the changes, but rather just adding spaces so that my code lines are approximately the same.**
    Notes on these spaces and the generally current code stand follow
    At the same the time, the following notes give a general review of the code from Chris, now a bit further on, before I write the whole thing from scratch. Basically the 11 Feb Live video came out while I was about to start my new from scratch script
    So I am combining a general review of the current stand of Chris’s code, win10debloatChris12Feb2022.ps1
    Share ‘win10debloatChris12Feb2022.ps1’ https://app.box.com/s/5lfgt22pqtly1g127ubnybj6ltn3j1x3

    , with my latest, Temp4.ps1
    Share ‘Temp4.ps1’ https://app.box.com/s/y291ha4eb906v7lkvd8ehzz9ii70cvoh


    Chris playing with his PoshGUI( 53:30 … don’t hate me for it! https://www.youtube.com/watch?v=WRg5nItpghA&t=3210s )
    Chris was playing with his PoshGUI again.
    Looking at what he does… I think as you put buttons on an existing thing that it will make the variable with the name you give it ( by default it will give you button1 , botton2, button6 etc.. as available, - as you re name it, then that default name, button1 , for example is available to poshGUI to use). I expects poshGUI will then automatically add that bloated button layout bit, and add appropriately the reference in the adding variable in the pane code lines.
    The $kkjash.Add_Click bit you do yourself, ( before or after ) but if you do it after, some intellisense offers the .Add_Click for it, amongst other things, when you write in the variable $kkjash.somewhere.
    The stuff you put in the $kkjash.Add_Click is the real meaty stuff that does anything. If Chris was doing this for himself, in his day job, he would just have all that meaty stuff and run that as he wanted



    So, This is a generally summary of mine since/ just after Chris’s, and the Live video
    Up to about 30 is some crap bloat, and the winget bit, then the Form is finished
    at about 40 and then we are mostly into the large repeated GUI produced button bloat
    To allow for 4 new buttons and a warning label made by Chris in that video, I make a big space from approx 620 – 650 , which pushes the small number ( 5-7 ) of Form Pane lines up to approximately 660


    So these 4 bloat button bits and a label is what posh GUI did
    $NFS
    $laptopnumlock #( ------ *** )
    $disableupdates
    $enableupdates
    $Label12

    That got added to the large form button repeated bloat section taking us to approx 860

    Me or Chris has got a line or two out of step, but we are approximately together, 866-867 Essential Tweaks starts, ……….._
    _........
    _.... ( with service tweaks starting at about 1056-1058 )
    As far as I can see, that Edge Bing start up tweak, ( https://github.com/nikilson/win10scr...e09a7125868e92 )
    Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Se arch" -Name "BingSearchEnabled" -Type DWord -Value 0 ; Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Se arch" -Name "AllowSearchToUseLocation" -Type DWord -Value 0
    , is still missing, ( Chris , I think, meant to put it just after end of services/essential tweaks … ( https://excelfox.com/forum/showthrea...ge50#post12767 ) )
    I have Essential Tweaks split up a bit. But we are finishing approximately together at 1156-1157

    We both have a dualboottime Add_Click and then I have made a space for a laptopnumlock which came in from Chris on the 11th Feb. He seemed to think it should have been there and he had forgotten it. ( *** Chris actually then duplicated a Add_Click which was already there- so he had just missed the button previously. )
    So we both start the essential undo at 1173. At this stage I have not split or changed any essential undo so we finish that at 1286.
    1288 – 1371 We then have a very large $windowssearch Add_Click which does not seem to have a button?? ( It has a short #commented out Cortana disable section )

    A short $backgroundapps Add_Click then
    1383 _
    __– 1404 A fairly large disable Cortana

    1406- 1496 The Bloatware array
    1497 – 1522 Button pair: removes and re ad bloat ( MS Store Apps )

    1524 – 1563 Button pair: default updates or the security only

    Up to about 1895 is mostly all other buttons used on script until the 11 Feb redesign, (*** and I note a strange $DisableNumLock Add_Click is a duplicate of the added on Feb 11 $laptopnumlock [ Laptop Numlock Fix ] ***

    Chris also slipped in the $NFS .Add_Click at 1790, so I have a space from 1790 to 1802

    1897 – end ( 2069 ) button pairs which were main theme from 11 Feb. $disableupdates .Add_Click $enableupdates .Add_Click
    So for mine I have a big space from 1897 – 2069


    Summary
    There is a very short GUI bit at the start that Chris never seems to go near anymore . This makes a meal of the very simple few lines that make a form, and fucks it up.

    The rest is all ( except for the meat behind the buttons, ( the $hfvafh Add-Click stuff ) bit ) all dome by PoshGui in a terribly jumbled up way.
    It’s so jumbled and messed up, that Chris often screws up putting the meaty bits in.






    win10debloatChris12Feb2022.ps1 https://app.box.com/s/5lfgt22pqtly1g127ubnybj6ltn3j1x3
    Temp4.ps1 ’ https://app.box.com/s/y291ha4eb906v7lkvd8ehzz9ii70cvoh









    Here is a few minor issues, which I might try to get across to him
    Num Lock chaos issue https://www.youtube.com/watch?v=WRg5...P1d2B994AaABAg https://www.youtube.com/watch?v=WRg5nItpghA&t=2210s
    At minute 36:50 he noticed by chance when doing something else, that some time previously he had missed a Disable NumLock after startup button and coding, so he made one , $laptopnumlock
    ( https://www.youtube.com/watch?v=WRg5nItpghA&t=2210s )
    629 $laptopnumlock = New-Object system.Windows.Forms.Button
    630 $laptopnumlock.text = "Laptop Numlock Fix"
    631 $laptopnumlock.width = 211
    632 $laptopnumlock.height = 30
    633 $laptopnumlock.location = New-Object System.Drawing.Point(4,267)
    643 $laptopnumlock.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',12)


    1164 $laptopnumlock.Add_Click({
    1165 Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0
    1166 Add-Type -AssemblyName System.Windows.Forms
    1167 If (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) {
    1168 $wsh = New-Object -ComObject WScript.Shell
    1169 $wsh.SendKeys('{NUMLOCK}')
    1170 }
    1171 })


    In fact he had only forgotten the GUI button, the Add Click coding was there
    1751 $DisableNumLock.Add_Click({
    1752 Write-Host "Disable NumLock after startup..."
    1753 Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 0
    1754 Add-Type -AssemblyName System.Windows.Forms
    1755 If (([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) {
    1756 $wsh = New-Object -ComObject WScript.Shell
    1757 $wsh.SendKeys('{NUMLOCK}')
    1758 }
    1759 $ResultText.text = "`r`n" +"`r`n" + "NUMLOCK Disabled"
    1760 })


    He is still screwing up the GUI size, I did a few comments again at YouTube. Most got deleted, as did late a lot of very helpful posts I did at GitHub




    Commit 17 Feb 2022
    Chris added some Virtual thing that I don’t understand yet. He did a video on 19 Feb.
    Apparently it is already there in Windows Pro, so he has a button in his troubleshoot section. So I guess the script he added behind the button does some of what you would do get the thing up and running.
    So I will do a simple Temp4.ps1 to Temp5.ps1 , making spaces so that Temp5.ps1 has the same line positioning of most stuff as this
    win10debloatChris17Feb2022.ps1
    https://app.box.com/s/fajb84rq6x2dz9vl0a6dhgbj8l5t8xku

    So we need to shift down some lines in mine from 657 for the button to the form:
    https://i.postimg.cc/Y23rjBBP/Shift-down-from-657.jpg
    and
    similarly for the coding behind the button, my Temp5.ps1 has the start line for the code behind update fix button, $windowsupdatefix.Add_Click({ , shifted down to 1826
    https://i.postimg.cc/VLkYCZYk/update...wn-to-1826.jpg

    That appears to be all I need to do, but while I am here……

    I seem to have not made the end space at the end for the 11 Feb enable and disable update meat behind the button stuff? - I am not sure if that was intentional, or whether that got truncated accidentally somehow.
    So going backwards up the script, I put some comment lines in to keep it in wach.
    https://i.postimg.cc/6p6YwRLS/adding...dded-by-me.jpg
    https://i.postimg.cc/P5Fzj7qp/adding...dded-by-me.jpg
    https://i.postimg.cc/zGMWMRdT/adding...dded-by-me.jpg

    In fact as a very last action for Temp5.ps1, I added some similar comment lines to help me orientate in the future to things added by Chris but not yet added by me.
    https://i.postimg.cc/YSzrF5mj/adding...dded-by-me.jpg
    https://i.postimg.cc/4yhj6cFw/adding...-yet-added.jpg
    https://i.postimg.cc/j51GncvL/adding...-yet-added.jpg
    https://i.postimg.cc/0NVgPPwG/adding...t-added-by.jpg
    https://i.postimg.cc/Y905SZ65/adding...added-by-m.jpg
    https://i.postimg.cc/6TJgYQkK/Chriss...king-lines.jpg
    https://i.postimg.cc/7YSZDJYg/Consol...everywhere.jpg
    https://i.postimg.cc/K8FvYcRC/Consol...everywhere.jpg
    https://i.postimg.cc/QN2dRJs8/Consol...everywhere.jpg


    ( Just one last thing. I #commented out the default winget install at this Temp5.ps1 stage, just because I want to do some testing later on virgin machines which involves investigating if this is done. I don’t want to do that currently )
    https://i.postimg.cc/9X7Wtw9v/Tempor...-temp5-ps1.jpg





    Temp5.ps1 https://app.box.com/s/vp8sdqoducp6rn1yj4dsb7edinasdjlf
    win10debloatChris17Feb2022.ps1 https://app.box.com/s/fajb84rq6x2dz9vl0a6dhgbj8l5t8xku



    Last edited by DocAElstein; 04-01-2022 at 10:52 PM.

  10. #500
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,313
    Rep Power
    10
    Chris got a bit ahead of me again, so here another update, going to my Temp6.ps1 from his version of around the 10-16 march, ( Commit 10 March, I took a copy on 16 March)

    Commit 10 March 2022 Power options added
    Main changes are
    _ a bit of reorganising of wording and buttons in the area of tweak, troubleshoot, fixes, and moving of Windows Update Reset button https://i.postimg.cc/FsQNtjzv/Temp5-...on-changes.jpg

    _ addition of two buttons , Restore Power Options and Win7 Power Panel, ( and I note here that in a recent video Chris noticed that he may have some duplicated stuff issues to take care of , https://youtu.be/KjHfCDPfLdI?t=153 ,
    https://excelfox.com/forum/showthrea...ge43#post12702
    )
    ( He seems to be referring now to Old jashdkjadh Panel stuff now as Win7 jashdkjadh Panel

    Putting things back into wach, that is to say some constancy in code line numbers between mine and Chris’s script , is a bit difficult for me in some places as Chris has taken out a bit of stuff, in places where I had an empty space**, ( all be it by the virtue of shifting some of his bloat in comments to the far right. So I would be working a bit blind).
    **This could cause problems if I have used these spaces for new things that I have added, I will need to be careful of this.
    I need to do this by first seeing the difference to lines in his February and March versions that I have, at least initially in the Label area
    ( One important thing to note here is that Chris may** have gone against his own religiously held rule of messing with the script parts given by his PoshGUI (** He may have not if he did the changes on the PoshGUI )
    To assist me I will make an in-between help file, based on a modified version of the script that was available from around 15-17 February

    The unusual changes involving removing lines
    _(i) Taking out $Label4 “Troubleshoot” = remove 8 lines , 293-300
    _(ii) Taking out $Label6 “Misc Fixes” = remove 8 lines , 426-433
    I remove these lines and save the modified script as win10debloatChris17Feb2022Bee.ps1 So this new ps1 File will be a modified version of the script that was available from around 15-17 February

    The more usual typical changes as a result of things being added
    _(iii) Adding a $oldpower button and $restorepower button requires adding in total 14 lines from 649.
    For later reference I will add comments
    649 # $oldpower
    656 # $restorepower
    Here is that last bit, where on the right is the current script from around 10-16 March script, and on the left is the modified version of the script that was available from around 15-17 February:
    https://i.postimg.cc/Hk6g7R2W/14-spa...s-from-649.jpg

    _(iv) The coding for the two new buttons starts at 1795, so from here we need to makes space down in the left coding in the following screenshot:
    https://i.postimg.cc/g2SC0Rzn/Space-...ns-at-1795.jpg


    ( The changes of moving button positioning: Doesn’t concern me. I ignore that, since I already messed around a lot with where my buttons are )

    That all now seems to be all needed to give me a modified version of the 15-17 February script,
    win10debloatChris17Feb2022Bee.ps1 https://app.box.com/s/xpgcidd0ouhcc4xb8lxpm8xop51oto19
    , which I will now use to partially help me to take my script to Temp6.ps1 from my Temp5.ps1
    _.__________

    _(i) Taking out $Label4 “Troubleshoot” = remove 8 lines , 293-300
    Luckily, it seems that I have not yet used the spaces made by Debloating Chris’s script, so I am free to delete the lines as before.
    This example shows a good illustration of the usefulness of keeping Chris’s original coding in green comments to the right: From this screenshot we immediately see the lines we need to remove.
    https://i.postimg.cc/T338GQXz/Remove-Label4.jpg
    Finally, removed Label4: https://i.postimg.cc/7Lby19s3/Removed-Label4.jpg

    _(ii) Taking out $Label6 “Misc Fixes” = remove 8 lines , 426-433
    Once again I have luckily not used yet the space created by removing Chris’s bloat,
    https://i.postimg.cc/L89S52j0/Remove-Label6.jpg
    https://i.postimg.cc/zf44CrRN/Remove-Label6.jpg
    (The best way to do this , by the way, is to select the lines all from holding the left mouse button down in the margin and dragging to select all the lines. Then use delete key or back (-ve Tab < ) key : https://i.postimg.cc/RVQ9vNJH/Remove-Label6.jpg )
    Finally removed Label6: https://i.postimg.cc/6QSxMZgD/Removed-Label6.jpg

    _(iii) Adding a $oldpower button and $restorepower button requires adding in total 14 lines from 649. I am having to work a bit blind here, and also I have used some of the space here obtained by Debloating Chris’s script around line 649,
    https://i.postimg.cc/XvrTBJqx/Used-a...e-from-649.jpg

    , but carefully adding 14 lines seems to bring everything back into wach, https://i.postimg.cc/RVRrjy21/carefu...nes-at-649.jpg
    and note coincidentally nicely separates the similar, but different sets of command lines
    _ the single form adding to GUI stuff $Form.controls.AddRange(@(
    and the
    _ various panel adding to GUI sdtuff $Panelaskjdg.controls.AddRange(@(


    A few comments to aid further orientation and we have this bit finished https://i.postimg.cc/cC7q1bCS/Adding...rientation.jpg

    _(iv) The coding for the two new buttons starts at 1795
    Fairly easy and straight forward:
    Here the Before screenshot : https://i.postimg.cc/brhM59TF/Before-iv.jpg
    Here the After screenshot : https://i.postimg.cc/FRc8GBjL/After-iv.jpg

    Just to finally remind us what is going on here: That last screenshot is showing. On the left my final Temp6.ps1 ; The screenshot on the right is a file used to aid me get in wach with Chris’s latest ps1 file.
    I can do a final quick check by substituting the right file for an actual current Chris ps1 script
    https://i.postimg.cc/yxy5C3p6/After-...-march2022.jpg









    Share ‘Temp6.ps1’ https://app.box.com/s/sn8dsqt237zffgkmjaqnvn7ewvqjdou8









    ( Link to first post on page #51
    Page 51, Post #501
    https://excelfox.com/forum/showthrea...ge51#post12776 )
    Last edited by DocAElstein; 03-18-2022 at 06:57 PM.

Similar Threads

  1. Tests and Notes on Range Referrencing
    By DocAElstein in forum Test Area
    Replies: 70
    Last Post: 02-20-2024, 01:54 AM
  2. Tests and Notes for EMail Threads
    By DocAElstein in forum Test Area
    Replies: 29
    Last Post: 11-15-2022, 04:39 PM
  3. Replies: 39
    Last Post: 03-20-2018, 04:09 PM
  4. Notes tests. Excel VBA Folder File Search
    By DocAElstein in forum Test Area
    Replies: 39
    Last Post: 03-20-2018, 04:09 PM
  5. Replies: 2
    Last Post: 12-04-2012, 02:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •