Results 1 to 7 of 7

Thread: Code callouts

  1. #1
    5 Star Lounger
    Join Date
    Jan 2010
    Location
    Fort McMurray, Alberta, Canada
    Posts
    615
    Thanks
    61
    Thanked 77 Times in 73 Posts

    Code callouts

    Current use (easy but not technically correct):

    wmic computersystem list brief
    Proper code window. Found under Advanced editing I believe:

    Code:
    wmic computersystem list brief
    OK, that was embarrassingly easy! Aside from proper formatting, are there other benefits to the code window?

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,558
    Thanks
    384
    Thanked 1,480 Times in 1,346 Posts
    BHarder,

    Yes, it makes it much easier, especially with longer code, for individuals to copy the code and paste it elsewhere to either help answer the question or copy the answers. IMHO.

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. The Following User Says Thank You to RetiredGeek For This Useful Post:

    BHarder (2016-10-16)

  4. #3
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,722
    Thanks
    124
    Thanked 678 Times in 616 Posts
    Aside from proper formatting, are there other benefits to the code window?
    BHarder,

    The code window also allows additional spaces between words along with indentation.

    Code:
    Private Sub Test()
        If X then Y      'NOTICE THE INDENTATION (4 SPACES) AND THE MULTIPLE SPACES "Y      'NOTICE"
    In a quote, spaces more that 1 will be automatically removed.

    Indentation allows code to be easily read and structured. when copy/psting the code, the indentation and multiple spaces are pasted as well.

    HTH,
    Maud

  5. #4
    Super Moderator
    Join Date
    Aug 2012
    Location
    Durham UK
    Posts
    6,952
    Thanks
    158
    Thanked 916 Times in 874 Posts
    I was copying & pasting code from an article to resolve the DCOM 10016 error, but as I was unable to scroll to highlight all of it, I had to copy & paste it in two parts.

    If anyone has a suggestion as to how to do that with the SetACL.exe cmds lower down in this article, I'd appreciate it as I have to repeat the procedure whenever I perform a Win 10 repair install.

    https://www.windows10forums.com/arti...ributedcom.47/

    If it wasn't in a code box it would be easier just as it is in this article for resolving a CAPI2 513 error.

    https://justworks.ca/blog/fix-event-...windows-backup
    Last edited by Sudo15; 2017-01-09 at 04:23.

  6. #5
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,422
    Thanks
    52
    Thanked 1,025 Times in 953 Posts
    I can highlight the contents of both boxes at once and copy. I means I get "code:" as a separate command, but it doesn't do anything so it's not an issue.
    Code:
    SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{8D8F4F83-3594-4F07-8369-FC3C3CAE4919}" -ot reg -actn setowner -ownr "n:SYSTEM"
    
    Code:
    
    SetACL.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{F72671A9-012C-4725-9D2F-2A4D32D65169}" -ot reg -actn setowner -ownr "n:NT SERVICE\TrustedInstaller"
    cheers, Paul

  7. #6
    Super Moderator
    Join Date
    Aug 2012
    Location
    Durham UK
    Posts
    6,952
    Thanks
    158
    Thanked 916 Times in 874 Posts
    When I dragged the mouse over the cmd of what I could see, I was unable to highlight all of it to right click on it again and select Copy.

    However, when I highlight what I can see then right click outside of the Code box and select Copy, I can get all of it in one go.

    Must remember that for next time

  8. #7
    5 Star Lounger
    Join Date
    Jan 2010
    Location
    Fort McMurray, Alberta, Canada
    Posts
    615
    Thanks
    61
    Thanked 77 Times in 73 Posts
    If anyone has a suggestion as to how to do that...
    Here's what I do. It's not perfect so YMMV.

    1). Click in the code box and then press [Ctrl-A]. If you are lucky (Windows Secrets articles are not lucky), you'll highlight the code in the box and nothing else. If you are not lucky, try Step 2;

    2). Click at the very top of the code box, and hold as you drag down. The initial click point is tricky to get because you are trying to get all of the first line, so you click at the extreme top left. I suspect no one here will be surprised by this. Anyhow when you've dragged the entire screen and the code continues off screen... Use the keyboard to scroll the screen. All keyboard direction keys work, but you'll mostly use [PageDown] and [ArrowDown]. And keep dragging the entire time you are doing this (the click-and-drag must be one continuous action, uninterrupted by anything). If this doesn't work, try Step 3;

    3). This technique is the opposite of Step 2. You do everything just like in Step 2, but you start your click-and-drag at the bottom of the code window and work your way up towards the top. Very often when a top down click-and-drag does not work, a bottom up click-and-drag will succeed;

    4). Any kind of dedicated Code button, or code download link, will usually get better results.

Tags for this Thread

Posting Permissions

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