Kodi Community Forum

Full Version: Hoping a Genius Can Make a Shortcut
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to change refresh rate from 60Hz to 24Hz and vice versa with a desktop shortcut of some sort.

Instead of digging through windows and menus, waiting for the change, and then selecting to accept the change before it reverts, I was hoping someone smarter than myself could create a shortcut.

Google says this was possible in XP but not Vista and upward. nvcpl.dll dtcfg is discontinued although I find it in System32? I'm using W8.1 with Nvidia.

http://soyouwillfindit.blogspot.com/2009...sktop.html

Couldn't get these to work either:
http://www.autohotkey.com/board/topic/99...anger-cmd/
http://12noon.com/?page_id=80



Image


Image
Unless I'm totally off track why not just turn on 'adjust refresh rate' option

http://kodi.wiki/view/Settings/Videos
Yes, I'm aware of that within Kodi. Need it for windows. Looking for this shortcut, script, bat file, whatever for an addition to playercorefactory I'm working on for 3D to complete the code. For the life of me, I can't do this part though.
Sorry, thought it was too easy.
what is the purpose of this?
All you want is to change between 60Hz and 24Hz quickly?
Give this one a try, it worked for me on Windows 8.1 x64:
http://www.majorgeeks.com/files/details/qres.html
Thank you so much a11599. That is exactly what I needed. Works perfectly. Rep point for you. Yes, the purpose is to manually change refresh rate quickly without the need for a program to call it up. Created 2 batch files; 1 for 60Hz, 1 for 24Hz.

My use is very specific and may apply for others. I'm sure some users have the same problem, they just don't know they do:
I use 1 PC and 1 panel for everything, an all in one box. HTPC Kodi, server, video editing, everyday computing, etc.

Although many dislike SOE (Soap Opera Effect aka Motion Rate) I happen to embrace it. I suspect those that dislike it fought the introduction of color TV , preferring B/W. Seems they also prefer vinyl to CD's, and stereo to 5.1 as well. To each his own...

Since I use an all in one box, I stream online video such as youtube/flashplayer outside of Kodi although Kodi has this built in. At 60Hz the video renders vanilla. At 24Hz SOE activates and the magic begins. Unfortunately, flashplayer, Windows, streaming sites or my panel do not automate the rate switch so it must be switched manually within Windows.

It would be wonderful to just leave the desktop at 24Hz but that creates unusable mouse/keyboard lag since large panels have slow response times, at least my Samsung does.

Furthermore, it gets more interesting using motion rate with 3D. Unless the judder and blur settings are set very low, aspect ratio goes into overscan when the 3D mode of the panel automates full frame packed titles. I prefer the settings higher so I aim to defeat that overscan. These shortcuts will help speed up testing and may be introduced into my present playercodefactory.xml while also enhancing playback outside of Kodi.

Now, I would like to have one batch file that does both switches. Toggle. If I'm in 60Hz, clicking it would switch to 24Hz and if I'm in 24Hz clicking the same batch file would switch to 60Hz.
Anyone know the code for (if 60Hz switch to 24Hz and If 24Hz switch to 60Hz)?

@echo off

qres.exe /r:24

exit

And add this to the code:

@echo off

qres.exe /r:60

exit

Currently trying to get this to work where all the files are in the root of C but something is wrong and I can't figure it out:

@echo off

CD /C %~dp0

if exist %~dp0Anext.txt (
call :A
goto :EOF
)
if exist %~dp0Bnext.txt (
call :B
goto :EOF
)
if not exist %~dp0*next.txt (
call :firstrun
goto :EOF
)
goto :EOF

:A
QRes.exe /r:60
echo AAA
echo B > Bnext.txt
del Anext.txt
goto :EOF

:B
QRes.exe /r:24
echo BBB
echo A > Anext.txt
del Bnext.txt
goto :EOF

:firstrun
QRes.exe /r:60
echo AAA
echo B > Bnext.txt
goto :EOF



Thank you once again for directing me to that .exe. Very pleased.
This idea should work, but I think you cannot create a file in C:\ from a non-elevated command prompt. Try doing this in a different directory (I usually have a C:\Programs where I copy all portable apps and scripts).
Wouldn't running as admin be the same thing? That's what I've been doing. If I'm in 24Hz and I click the big batch file posted above twice, it does switch to 60Hz. It just doesn't do anything if I click it again. The CMD flashes but that's it.
No, it's different actually. Being admin does not grant your user elevated privileges ("UAC stuff"). Save this file as switch.js in the same directory where you have QRes.exe:

Code:
(function() {
    var refreshRate = 0;

    // Get current refresh rate

    var wmiService = GetObject('WinMgmts://./root/cimv2');
    refreshRate = new Enumerator(
        wmiService.ExecQuery('SELECT * FROM Win32_VideoController WHERE Availability <> 8')
    ).item(0).CurrentRefreshRate;
    
    if (typeof refreshRate != 'number' || refreshRate === 0) {
        WScript.Echo('Duh. Cannot determine current refresh rate.');
    } else {

        // Run QRes.exe

        var fs = new ActiveXObject('Scripting.FileSystemObject');
        var shell = new ActiveXObject('WScript.Shell');
        shell.Run(fs.GetAbsolutePathName(fs.BuildPath(fs.GetParentFolderName(WScript.ScriptFullName), 'QRes.exe')) + ' /r:' + (refreshRate == 60 ? 24 : 60), 0, true);
    }
})();

It's a Windows Scripting Host script that will detect your current refresh rate and toggle between 24/60 Hz without using temporary files. It should normally work on a simple double click. Bonus: no command window will be shown. Smile
On the other hand if you want to go with a batch file solution the following should work as well:

Code:
@echo off

if exist "%~dp024.hz" goto hz60
"%~dp0QRes.exe" /r:24
echo 24Hz>"%~dp024.hz"
goto :eof

:hz60
"%~dp0QRes.exe" /r:60
del "%~dp024.hz"
Folders like C:\. C:\Windows\, C:\Program Files\ and so on are protected by the OS (for good reason). So it is far easier to just set your stuff up elsewhere as A11599 suggests.

Personally I leave the C drive to Windows and tend to do my work on D:\ (But then I am a geek who knows how to move the \users\ folder)

Even simple ideas like creating C:\MyStuff\ as a11599 suggests saves sooooo many headaches. No point trying to fight Windows. And "Run as admin" is a bit daft when all you want to do is write to a folder.


Qres.exe is excellent.... have been using that since the 90s to solve stuff like this!
Created a folder in Documents named AdjustRefreshRate. Put QRes.exe inside it. Created .txt and renamed to switch.js in the same folder and edited your code into it. Saving prompts pop-up "File contains characters in Unicode which will be lost if saved as ANSI, select another Unicode option....etc."

Tried everything in the drop down and saved. Clicked the .js and I get Windows Script Host pop-up " Microsoft JScript compilation error" and other details.
WooHoo! The .bat works perfect. Happy Days are here again. Another rep point for you. You earned it. Thank you so much!!!!!!!
Pages: 1 2