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.
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.
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: Spoiler 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" :--------------------------------------
Hello. Code: Scheduled Tasks Tweaks: - Disables all default Windows tasks is this really good thing to do?
Sorry for the confusion. Not all tasks get disabled, only the unneeded ones link telemetry/feedback/error-reporting. Will change this in OP now.
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.
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. If i restore scheduled task everything its working again. Thanks for your time and this great script.
That's odd, never ran into any problem like that. I will look into it. Also v6.4.1 released with some bugs fixed.
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.
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.
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.