[Script] Windows 10 TNBT (The next big Tweak) v6.5.6 -official thread-

Discussion in 'Windows 10' started by uniQ168, Aug 2, 2015.

  1. kronflux

    kronflux MDL Member

    May 11, 2011
    112
    22
    10
    #261 kronflux, Sep 5, 2016
    Last edited by a moderator: Apr 20, 2017
    Odd! I use it in all my scripts that require elevation, and have never run into issues. As far as I can tell, the only real difference is that it uses the architecture appropriate cacls, and uses cmd to launch the vbs script created.

    Perhaps a conflict with something else, or it didn't get copied correctly?
    regardless, if you change
    Code:
    set params = %*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
    back to
    Code:
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
    it should work, seems whatever is causing the issue doesn't like that cmd launch.

    As you said, it's not -necessary- but it is nice to use the appropriate method. *shrug*

    Thanks for taking my input into mind though! like I said, project definitely has potential. :)
     
  2. zamica

    zamica MDL Member

    Oct 1, 2012
    147
    21
    10
    thanks for keeping it updated
     
  3. uniQ168

    uniQ168 MDL Junior Member

    Jul 18, 2015
    75
    319
    0
    #263 uniQ168, Sep 6, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    No problem. Like I said, I welcome any kind of feedback.

    "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" will always cause a loop, you might try it yourself. Definitely not working this way. ;)
     
  4. kronflux

    kronflux MDL Member

    May 11, 2011
    112
    22
    10
    #264 kronflux, Sep 6, 2016
    Last edited by a moderator: Apr 20, 2017
    Hmm. So I just noticed in some of my VM's that some OS's I'm using have 64-bit registry files present, and some do not. And those which do, still have the 32-bit registry present(who knows which is actually used, but the point is that all we're doing is checking if we have access to a particular file that we know exists) So the only check you'd really have to do is for CACLS..
    Code:
    IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
    IF EXIST "%SYSTEMROOT%\SysWOW64\cacls.exe" (
    >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\System32\config\system"
    ) ELSE (
    >nul 2>&1 "%SYSTEMROOT%\System32\cacls.exe" "%SYSTEMROOT%\System32\config\system"
    ))
    (or if you wanted to be REALLY thorough, you could do a full check)
    Code:
    IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
    IF EXIST "%SYSTEMROOT%\SysWOW64\cacls.exe" (
    IF EXIST "%SYSTEMROOT%\SysWOW64\config\system" (
    >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
    ) ELSE (
    >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\System32\config\system"
    )) ELSE (
    >nul 2>&1 "%SYSTEMROOT%\System32\cacls.exe" "%SYSTEMROOT%\System32\config\system"
    ))
    Sorry about that. I hadn't thought of the possibility that the OS may not have those files present, but would have 64-bit CACLS present.
    Since we didn't have a check in there at all, it would just keep trying..


    Full thorough code:
    Code:
    :: BatchGotAdmin
    :-------------------------------------
    REM  --> Check for permissions
    IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
    IF EXIST "%SYSTEMROOT%\SysWOW64\cacls.exe" (
    IF EXIST "%SYSTEMROOT%\SysWOW64\config\system" (
    >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
    ) ELSE (
    >nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\System32\config\system"
    )) ELSE (
    >nul 2>&1 "%SYSTEMROOT%\System32\cacls.exe" "%SYSTEMROOT%\System32\config\system"
    ))
    
    REM --> If error flag set, we do not have admin.
    if '%errorlevel%' NEQ '0' (
        echo Requesting administrative privileges...
        goto UACPrompt
    ) else ( goto gotAdmin )
    
    :UACPrompt
        echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
        set params = %*:"=""
        echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
        "%temp%\getadmin.vbs"
        del "%temp%\getadmin.vbs"
        exit /B
    :gotAdmin
        if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
        pushd "%CD%"
        CD /D "%~dp0"
    :--------------------------------------
     
  5. Hadron-Curious

    Hadron-Curious MDL Guru

    Jul 4, 2014
    3,613
    542
    120
    Where is the link to the full ''source code'' after making changes?
     
  6. uniQ168

    uniQ168 MDL Junior Member

    Jul 18, 2015
    75
    319
    0
  7. AnimaliX

    AnimaliX MDL Novice

    Jul 28, 2009
    44
    23
    0
    #270 AnimaliX, Sep 7, 2016
    Last edited by a moderator: Apr 20, 2017
    Hello.

    Code:
    Scheduled Tasks Tweaks:
    - Disables all default Windows tasks
    is this really good thing to do? :)
     
  8. uniQ168

    uniQ168 MDL Junior Member

    Jul 18, 2015
    75
    319
    0
    #271 uniQ168, Sep 7, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Sorry for the confusion. Not all tasks get disabled, only the unneeded ones link telemetry/feedback/error-reporting. Will change this in OP now.
     
  9. jasongenova

    jasongenova MDL Junior Member

    Jan 23, 2016
    75
    20
    0
    Did OP abandon ship?
     
  10. uniQ168

    uniQ168 MDL Junior Member

    Jul 18, 2015
    75
    319
    0
    Updated to v6.4 with some fixes here and there. ;)
    I will work on a better way to autorun the anti-ransomware script.

    Nope, I was just busy the last few days.
     
  11. Dycedarg

    Dycedarg MDL Novice

    Dec 20, 2012
    5
    0
    0
    Cant write on Microsoft Edge or Wifi Settings

    After apply the option Scheduled Tasks Tweaks i cant write in edge browser or if i have to write wifi password.:confused:

    If i restore scheduled task everything its working again.:confused:

    Thanks for your time and this great script.
     
  12. moitreker

    moitreker MDL Novice

    Oct 21, 2015
    2
    0
    0
    #275 moitreker, Sep 29, 2016
    Last edited: Sep 29, 2016
    super super super super
     
  13. uniQ168

    uniQ168 MDL Junior Member

    Jul 18, 2015
    75
    319
    0
    That's odd, never ran into any problem like that. I will look into it.
    Also v6.4.1 released with some bugs fixed. ;)
     
  14. Dycedarg

    Dycedarg MDL Novice

    Dec 20, 2012
    5
    0
    0
    I will try and inform you asap.

    Thanks for your time.
     
  15. wazer

    wazer MDL Junior Member

    Jul 31, 2009
    64
    9
    0
    You should not have hower taskbar/start menu delay put on 0, it causes mess and programs supporting hower function cannot be clicked on since hower is remoed instant, i suggest 100ms as default also let people decide if they want windows audio back.
     
  16. getsuga369

    getsuga369 MDL Junior Member

    Apr 14, 2015
    64
    17
    0
    Hi there, I used your script but there is something I wish it wouldn't do. How can I exempt it from disabling local search (files only) in windows 10?
    May I know the correct registry so that I can use file search when I enable scheduled task tweak?

    Thnx in advance.
     
  17. uniQ168

    uniQ168 MDL Junior Member

    Jul 18, 2015
    75
    319
    0
    #280 uniQ168, Oct 3, 2016
    Last edited: Oct 3, 2016
    (OP)
    The registry tweaks will only disable websearch/cortana and remove the searchbar from taskbar.
    On my previously tested VMs, local search always worked.

    I agree on the delay, this is already fixed in the upcoming v6.5 release.
    Again, I won't add too many switches in the script, since this is not it's purpose. If you want a more flexible solution, please use Toggle Tweaker.

    EDIT: v6.5 is out. ;)